如何在同一个 apache 服务器上为两个项目运行两个版本的 PHP

我的 apache 服务器上有 2 个不同的虚拟主机。其中一个需要php7.x,另一个需要php5.x。

是否可以使用项目特定的 PHP 版本?

但是我的 apache 服务器崩溃了,说 fpm 的配置文件之一中存在一些语法错误。

此外,我无法遵循此解决方案,因为它建议卸载 apache 并重新开始,而我无法在实时服务器上执行此操作。

有没有办法在不卸载apache服务器的情况下做到这一点。谢谢你的建议。


呼啦一阵风
浏览 171回答 2
2回答

四季花海

对于文件 httpd-vhosta.conf 上的 Windows<VirtualHost *:80>&nbsp; &nbsp; DocumentRoot "d:/server/htdocs/"&nbsp; &nbsp; ServerName localhost&nbsp; &nbsp; ServerAlias www.localhost&nbsp; &nbsp; <Directory "d:/server/htdocs/">&nbsp; &nbsp; &nbsp; &nbsp; Require all granted&nbsp; &nbsp; &nbsp; &nbsp; <Files ~ "\.php$">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddHandler fcgid-script .php&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #FcgidWrapper "d:/server/php/php-5.6.40-Win32-VC11-x64/php-cgi.exe" .php&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FcgidWrapper "d:/server/php/php-7.1.24-Win32-VC14-x64/php-cgi.exe" .php&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Options +ExecCGI&nbsp; &nbsp; &nbsp; &nbsp; </Files>&nbsp; &nbsp; </Directory>&nbsp; &nbsp; ErrorLog "D:/server/apache/logs/error-localhost.log"&nbsp; &nbsp; SetEnv APP_ON_LOCAL 1</VirtualHost>

温温酱

如何在 Debian Etch 上使用 mod_fcgid 和 PHP5 设置 Apache2&nbsp;https://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-debian-etch
打开App,查看更多内容
随时随地看视频慕课网APP