• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Site Looking at wrong PHP.ini file.

iRapture

New Pleskian
Plesk 11.0.9 on Centos 6.4
Running php as FastCGI

I have a site that for some reason is pointing to a php.ini in another site's directory. So as an example:

site1.com has a php.ini file located in /var/www/vhosts/site1.com/etc/php.ini
site2.com has its own php.ini file located in /var/www/vhosts/site2.com/etc/php.ini

However site2.com isn't using its own php.ini but has somehow been pointed to /var/www/vhosts/site1.com/etc/php.ini.

So when I update php settings in the panel for one of the sites it causes the other site to cease working and vise versa. Because the settings in that php.ini such as include path and open base directory are changed to match the last site to have committed the php settings.

I've not run into this sort of issue before and can't seem to find where I might be able to fix it. Any suggestions as to how I could correct site2.com so it looks at /var/www/vhosts/site2.com/etc/php.ini as it is supposed to would be greatly appreciated.
 
2 Separate subscriptions, I even completely removed and recreated one of the subscriptions thinking perhaps the system had mistakenly given them both the same identifier or something along those lines. Still didn't fix the problem.
 
Last edited:
Hi iRapture -

I don't know if this helps you or not, but on my server it appears the php.ini setting is in /var/www/vhosts/sitename.com/conf/last_httpd.include:

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/sitename.com/etc/php.ini

<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/sitename.com/etc/php.ini
FcgidMaxRequestLen 16777216
</IfModule>

You shouldn't be editing this file manually, as it is a file managed by Plesk and could be regenerated when you make changes through the web console. However, perhaps you copied this file from one site to another mistakenly once?


Another thing to be aware of is that last_httpd.include is just a symbolic link, the real file in my case is /var/www/vhosts/sitename.com/conf/13893817730.64203200_httpd.include. Yours will have different numbers than mine.
 
Good thought, but I haven't copied any of the configuration files. And I can confirm that the current httpd.include for each domain contains the accurate corresponding php.ini pointer for each site. So site2 seems to just be referencing the wrong configuration file, because it's definitely being affected by the other site's php.ini. And also updates the other site's php.ini file when a change is made from the panel. I suspect the problem must exist somewhere in the psa database. Does anyone know where that reference is stored?
 
I would love to take a look at this, as it's interesting and weired at the same time :)
However, I would also suggest you start by regenerating ALL the vhosts configuration files with:

Code:
/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
 
As frustrating as it is, I agree it does seem quite the unusual problem to have and is therefore in its own way intriguing. I'm working around it currently by running php as an apache process on one of the sites so it isn't using that php.ini. But would like to figure it out still to truly resolve the issue. I did try reconfiguring all sites as recommended. Site2 still looks at the Site1 php.ini file after reconfiguring.
 
Back
Top