Here’s the background:
In Docker, a container Alpine runs Apache (2.4.33, MPm_Event),
The other container runs PHP-FPM (7.2.8), so Apache and PHP-FPM are in remote linkage mode.
Many Settings refer to a large number of night data debugging, and all errors are reported:
AH01071: Got error ‘Primary script unknown\n’
After verification of configuration one by one, it is inconceivable that the problem is found. Let’s first give the correct configuration:
1. HTTPD. Conf
* Clear out lines like AddType Application/x-httpd-PHP PHP php7, which are not used by PHP-FPM.
* Similar paragraphs like the following are not required in httpd.conf:
< FilesMatch \.php$> SetHandler “proxy:fcgi://php-fpm:9000” < /FilesMatch>
2. The correct configuration requires only one line:
ProxyPassMatch ^/(.*\.php(/.*)?) $ fcgi://php-fpm:9000/v/php-fpm/www/$1
Put this line in your vhost.conf < VirtualHost> In the water.
Pay special attention!
1. My DocumentRoot path and the last path of ProxyPassMatch do not match!
(DocumentRoot/V/Apache/WWW) Apache startup needs to actually detect the existence of DocumentRoot path memory. That is, my data is in the Apache container, and after fCGI :// pushes the data to the PHP-FPM container, the PHP-FPM container needs to read this/V/Apache/WWW path, if it does not read, it will report an error AH01071. The foreground page says “File Not Find!”
Therefore, the core idea of the solution is to make the two containers have a common accessible file address. This is not redundant, with mount and other ways to solve.
2. Note the phP-FPM listen Settings
\php-fpm.d\www.conf
My listen = 172.0.0.3:9000
Here you cannot write 127.0.0.1, two containers in a virtual Intranet segment, and you can also write the Intranet address of the segment.
Read More:
- Apache startup error ah00534: httpd: configuration error: more than one MPM loaded
- AH01075: Error dispatching request to
- Job for apache2.service failed apache2 cannot be started
- AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
- AH00557: httpd: apr_sockaddr_info_get() failed for CentOS6.5.0
- [Sovled] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
- Apache2 cannot be started and an error is reported for apache2.service failed because the control process exited with error code.
- Unity3d mount script error “can’t add script behavior TMP”_ CoroutineTween. …”
- Apache service can’t be started under xampp, reporting port occupancy class error [error] Apache will not start without the configured ports free!
- systemctl start docker Job for docker.service failed because the control process exited with error
- Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibat
- The docker copies the win10 host file into the docker container. An error is reported: copying between containers is not supported
- Duplicate entry ‘787192513’ for key ‘primary’
- SCRIPT1002: syntax error File: 0. chunk.js ,SCRIPT5009: ‘Map‘ is undefined File: 0. chunk.js -Solutions
- Solve Linux docker pull error get https://registry-1.docker.io/v2/ : Net / http: TLS handshake timeout
- PHP error Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error:
- [reprint and save] MySQL does not set the primary key and uses the self growing ID method
- Txt import MySQL: error 1062 (23000): duplicate entry ‘0’ for key ‘primary’
- [xampp] error: Apache shutdown unexpected. 11:00:50 [Apache] solution details
- ValueError: Unknown label type: ‘unknown‘