0

I have a weird situation here in my configuration of Apache. I have decided to use FastCGI and multiple versions of PHP. Below are my configuration files.

If I check phpinfo(); I can see that on domain localhost it is loading php.ini from folder php56. This is OK. What I don't understand, why on domain localhost7 it is loading php.ini from folder php71. I don't change PHPRC somewhere for PHP7, but it is loading different config file. How this works, or why it is loading php.ini from different folder?

If I changed PHPRC to totally different folder, it works also. Is this constant not used, or it is because I'm on Windows (different behaviour)?

<IfModule fcgid_module>
    FcgidInitialEnv PATH "C:/www/xampp/php5.6;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
    FcgidInitialEnv SystemRoot "C:/Windows"
    FcgidInitialEnv SystemDrive "C:"
    FcgidInitialEnv TEMP "C:/www/xampp/tmp"
    FcgidInitialEnv TMP "C:/www/xampp/tmp"
    FcgidInitialEnv windir "C:/WINDOWS"
    FcgidIOTimeout 64
    FcgidConnectTimeout 16
    FcgidMaxRequestsPerProcess 1000 
    FcgidMaxProcesses 3
    FcgidMaxRequestLen 8131072
    # Location php.ini:
    FcgidInitialEnv PHPRC "C:/www/xampp/php5.6/"
    FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000

    <Files ~ "\.php$">
        Options Indexes FollowSymLinks ExecCGI 
        AddHandler fcgid-script .php
        FcgidWrapper "C:/web/xampp/php5.6/php-cgi.exe" .php
    </Files>
</IfModule>

Virtual hosts config file:

<VirtualHost *:80>
    DocumentRoot "C:/web/xampp/htdocs/"
    ServerName localhost7

    <Directory "C:/web/xampp/htdocs/"> 
        <Files ~ "\.php$"> 
            Options +ExecCGI
            FcgidWrapper "c:/web/xampp/php7.1/php-cgi.exe" .php 
        </Files> 
    </Directory> 
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "C:/web/xampp/htdocs/"
    ServerName localhost

    <Directory "C:/web/xampp/htdocs/"> 
        <Files ~ "\.php$"> 
            Options +ExecCGI
            FcgidWrapper "c:/web/xampp/php5.6/php-cgi.exe" .php 
        </Files> 
    </Directory> 
</VirtualHost>
0

I'm so ashamed :(

Please, check your paths twice (or more times), problem is always there. If you check it, I had path to php-cgi.exe C:\web\... but to PHPRC it is C:\www\.... And this is only reason.

And correct php.ini was loaded, because it is default behaviour. Here is order of places, where PHP is searching for php.ini file: http://php.net/manual/en/configuration.file.php

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.