• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Plesk 11.5 multiple php versions: php.ini files do not load

Just tried this hoping for a neat solution. I was hoping I could place only the variables I wanted for a particular domain to use in /var/www/vhosts/system/mywebsite.TLD/etc/php.ini.

Make sure you are running PHP as a FastCGI, it should work with your custom variables placed in /var/www/vhosts/system/mywebsite.TLD/etc/php.ini I have tested it!
 
Explain why you think it's worse?

Primary reason is that it will be very hard to diagnose and track down reason for unexpected behavior in future. Secondary is that this is unnecessarily powerful method (i.e., stronger than setting normal permissions) which implies side effects. Third reason is that it is dependent on file system support.

Regarding empty php.ini: it may not be immediately obvious but php.ini file in question IS the primary one. This is how it goes.
 
Last edited:
It is indeed FastCGI, but an empty php.ini doesnt load the master file. Placing only one variable inside it changes the value for both domain and master files in phpinfo().
 
it changes the value for both domain and master files in phpinfo().
This is NOT true! The changes you make in the custom /var/www/vhosts/system/mywebsite.TLD/etc/php.ini file only affect the domain name in question and NOT the entire server.

If you must have LOCKED IN changes for a domain name again I would propose the following:

You let the custom file
Code:
/var/www/vhosts/system/mywebsite.TLD/etc/php.ini
be generated normally by plesk, make all the changes you want in it as to your preference and then LOCK the file against any plesk changes with

Code:
chattr +i /var/www/vhosts/system/mywebsite.TLD/etc/php.ini

Whatever php changes you will make in plesk GUI you will get the error message

Code:
Error: phpinimng failed: [Errno 13] Permission denied: '/var/www/vhosts/system/us.amnotseen.com/etc/php.ini'

That error is totally harmless and you will not get any problems whatsoever as opposed by Nikolay ...

Anytime you want to make changes again to your
Code:
chattr +i /var/www/vhosts/system/mywebsite.TLD/etc/php.ini
you just run the command
Code:
chattr -i /var/www/vhosts/system/mywebsite.TLD/etc/php.ini
to UNLOCK it.

I have worked with these locks on some system files for years and have not landed into any trouble! As long as you know what you are doing ...
 
This is NOT true! The changes you make in the custom /var/www/vhosts/system/mywebsite.TLD/etc/php.ini file only affect the domain name in question and NOT the entire server.

I just want to clarify what I said. You are correct in that the file only affects the domain in question and not the server. What I meant was in phpinfo(), there are two columns that show both the master and domain specific PHP variables. If I place a variable here, phpinfo() shows this value as both local and master. But the above looks like a solid game plan.
 
Since there is only 1 php.ini file that can be loaded at anyone time, the loaded file in this case your custom
Code:
/var/www/vhosts/system/mywebsite.TLD/etc/php.ini
acts as your master and local ..

However, the situation is slightly different with Nginx and .htaccess. Instead with Nginx or .htaccess the preset php tags over-ride the master
Code:
/etc/php.ini
or
Code:
/var/www/vhosts/system/mywebsite.TLD/etc/php.ini
tags and the un-preset tags are picked from the master.

In the above, .htaccess acts as local while
Code:
/var/www/vhosts/system/mywebsite.TLD/etc/php.ini
would act as master ...
 
Forgive me for asking, but I am still a bit of a newbie to all of this. Especially when it comes down to Nginx and Apache. My understanding is that these are both web servers, and yet they seem to be running at the same time in Plesk. I normally use XAMPP so I never deal with Nginx. I have no idea why this is. Just so in case one goes down, there is a backup HTTP server? But I guess if PHP is configured to run as CGI, then it doesn't deal with either of these. Nevertheless, you mentioned custom PHPs can be run with Apache in the other post. I assume you didn't mean as mod_php, but some other magical workaround? As I said the php_handler wont let me assign Apache. There is a bit of hype on the PHP site that CGI is not secure and FastCGI takes up memory. This is the only reason I am interested in running it under Apache.
 
Last edited:
i have the same problem. in addition i installed a new php-version (5.3.27) and if i assign this new version a client, so the right php-version is executed, but the mentioned php.ini take no effect!
only if i change some php-settings directly on the customers domain, the settings take affect. further i must set also important typical/standard-settings (php modules, pear/pecl, .. such as imagemagick, suhosin, ...) manually.
this can´t be the solution! when will this bug fixed? i have to install yet another php-versions, ....
 
Back
Top