Same php.ini path for different used PHP versions!

mbsmt

Verified User
Joined
Jul 24, 2013
Messages
140
Location
Mashhad, Iran
Hey guys.
I've set PHP 5.6 as the first relase and 7.0 as the second one in Custombuild and installed them completely on my server. Then I changed the main PHP version of one website from 5.6 to 7 and ran the code below on it and another website (running with PHP 5.6)
PHP:
<?php
echo phpversion().'<br>'.php_ini_loaded_file();
?>
Results were:
Code:
7.0.17
/usr/local/php56/lib/php.ini
and
Code:
5.6.30
/usr/local/php56/lib/php.ini

Is not it strange? Both cases are telling loaded php.ini are same, whereas they are running two different versions of PHP. In this case, I can not have PHP 7 special settings on its php.ini file.
 
Last edited:
I had the same problem before on my old server. After the reinstall the issue is no longer appearing on my end. The old server was php1 mod_php and php2 SUphp. The new server is both php versions on SUphp.
 
That's due to how php.ini is loaded with suPHP:

/etc/httpd/conf/extra/httpd-suphp.conf

Code:
...
<Location />
    suPHP_Engine on
    suPHP_ConfigPath /usr/local/php56/lib/
...
</Location>
</IfModule>

This way it's global, and can not be re-defined later.

Related: http://forum.directadmin.com/showthread.php?t=52085 . Never released and still you can do the modification manually though.
 
That's due to how php.ini is loaded with suPHP:

/etc/httpd/conf/extra/httpd-suphp.conf

Code:
...
<Location />
    suPHP_Engine on
    suPHP_ConfigPath /usr/local/php56/lib/
...
</Location>
</IfModule>

This way it's global, and can not be re-defined later.

Related: http://forum.directadmin.com/showthread.php?t=52085 . Never released and still you can do the modification manually though.

Thank you Alex. I've put a question there at your given link.
 
Back
Top