Apache default apache2handler run processing php.
Below that switching method:
1, download fastcgi module, open https://www.apachelounge.com/download/ select the VC version download, I compiled using VC14, VC14 is so selected version
2, download, unzip, copy the file to mod_fcgid.so Apache modules directory installation path
3, open the httpd.conf configuration file, add the following code
LoadModule fcgid_module modules/mod_fcgid.so <IfModule fcgid_module> FcgidIOTimeout 60 FcgidConnectTimeout 30 FcgidMaxProcesses 8 FcgidOutputBufferSize 64 ProcessLifeTime 240 FcgidMaxRequestsPerProcess 500 FcgidMinProcessesPerClass 0 Options ExecCGI AddHandler fcgid-script .php # Php installation directory of your project FcgidWrapper "D:/wamp/bin/php/php7.0.23/php-cgi.exe" .php </IfModule>
This time it has been switched to restart Apache done
but I configured a virtual host, so I have to do to change the virtual host
4, the original virtual host configuration
<VirtualHost *:80> ServerName myphalcon.com ServerAlias myphalcon.com DocumentRoot "${INSTALL_DIR}/www/myphalcon/public" <Directory "${INSTALL_DIR}/www/myphalcon/public/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost>
After changing (ExecCGI Options is just configured)
<VirtualHost *:80> ServerName myphalcon.com ServerAlias myphalcon.com DocumentRoot "${INSTALL_DIR}/www/myphalcon/public" <Directory "${INSTALL_DIR}/www/myphalcon/public/"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require local </Directory> </VirtualHost>
If you need to set a different version of php, may be added in the module
FcgidWrapper "D:/wamp/bin/php/php5.6.31/php-cgi.exe -c D:/wamp/bin/php/php5.6.31/phpForApache.ini" .php
which is
<VirtualHost *:80> ServerName localhost ServerAlias localhost DocumentRoot "${INSTALL_DIR}/www" <Directory "${INSTALL_DIR}/www/"> Options +Indexes +Includes +FollowSymLinks +MultiViews #Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require local FcgidWrapper "D:/wamp/bin/php/php5.6.31/php-cgi.exe -c D:/wamp/bin/php/php5.6.31/phpForApache.ini" .php </Directory> </VirtualHost>
5, restart Apache
Turn: https://blog.csdn.net/u014691098/article/details/80159574