问题:使用Apache2.4配置php7.0.6和php7.2.1,php7.0.6可以启动,而php7.2.1无法启动。
httpd.conf配置参数如下:
<IfDefine php7.0.6>
LoadModule php7_module "C:/php7.0.6/php7apache2_4.dll"
PHPIniDir "C:/php7.0.6"
</IfDefine>
<IfDefine php7.2.1>
LoadModule php7_module "C:/php7.2.1/php7apache2_4.dll"
PHPIniDir "C:/php7.2.1"
</IfDefine>
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-httpd-php .php .inc
</IfModule>
CMD执行安装服务命令的结果如下:
C:\Apache24\bin>httpd.exe -k install -n "Apache2.4_PHP7.2.1" -D php7.2.1
Installing the 'Apache2.4_PHP7.2.1' service
The 'Apache2.4_PHP7.2.1' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
CMD测试安装好像也是OK的:
C:\Apache24\bin>httpd.exe -n "Apache2.4_PHP7.2.1" -t
Syntax OK
但是创建的Apache2.4_PHP7.2.1服务无法启动,error.log文件内有如下的错误记录:
[Tue Jan 09 10:51:37.960749 2018] [core:warn] [pid 12396:tid 604] AH00098: pid file C:/Apache24/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
PHP扩展的extension全部都是注释状态的,PHP.ini文件是初始状态的,只修改了extension_dir。
德玛西亚99