ronrun
ronrun

Reputation: 1234

Multi php version not working with 7.1.4

apache and php

three sites

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 [email protected]
    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 [email protected]
    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 [email protected]
    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>

Open browser, visit: 1. http://php56.local/phpinfo.php 2. http://php70.local/phpinfo.php 3. http://php71.local/phpinfo.php 1 and 2 are ok. Only php 7.1.4 always Internal Server Error.

Why?

Upvotes: 1

Views: 3988

Answers (1)

ronrun
ronrun

Reputation: 1234

I found where the problem is.

The two php versions which are ok, have no php.ini, I didn't deal with it. Maybe some default values is used.

The php version which can't work, I copied php.ini-development to be php.ini, but didn't change extension_dir.

After I set extension_dir = "D:/webserver/php/php-7.1.4-Win32-VC14-x64/ext" All works.

Upvotes: 5

Related Questions