apache和php
三个网站
的httpd-vhosts.conf
AddType application/x-httpd-php .php
ScriptAlias /php-7.1.4/ "D:/webserver/php/php-7.1.4-Win32-VC14-x64/"
ScriptAlias /php-7.0.18/ "D:/webserver/php/php-7.0.18-Win32-VC14-x64/"
ScriptAlias /php-5.6.30/ "D:/webserver/php/php-5.6.30-Win32-VC11-x64/"
<Directory "D:/webserver/php">
Order allow,deny
Allow from all
Require all granted
</Directory>
<Directory "D:/wwwroot">
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:\wwwroot\tests\php56"
ServerName php56.local
ErrorLog "logs/php56-error.log"
CustomLog "logs/php56-access.log" common
<Directory "D:\wwwroot\tests\php56">
Action application/x-httpd-php "/php-5.6.30/php-cgi.exe"
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:\wwwroot\tests\php70"
ServerName php70.local
ErrorLog "logs/php70-error.log"
CustomLog "logs/php70-access.log" common
<Directory "D:\wwwroot\tests\php70">
Action application/x-httpd-php "/php-7.0.18/php-cgi.exe"
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:\wwwroot\tests\php71"
ServerName php71.local
ErrorLog "logs/php71-error.log"
CustomLog "logs/php71-access.log" common
<Directory "D:\wwwroot\tests\php71">
Action application/x-httpd-php "/php-7.1.4/php-cgi.exe"
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
打开浏览器,访问: 1. http://php56.local/phpinfo.php 2. http://php70.local/phpinfo.php 3. http://php71.local/phpinfo.php 1和2都可以。只有php 7.1.4总是内部服务器错误。
为什么?
答案 0 :(得分:0)
我发现了问题所在。
两个php版本没问题,没有php.ini,我没有处理它。可能使用了一些默认值。
php版本无法正常工作,我将php.ini-development复制为php.ini,但没有改变extension_dir。
我设定后 extension_dir =&#34; D:/webserver/php/php-7.1.4-Win32-VC14-x64/ext" 一切正常。