• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

[BUG] Site php.ini is ignored under subdomains

LinqLOL

Basic Pleskian
General
It seems that when using subdomains the php.ini of the site is not being used but the system wide php.ini in the /etc directorie.
This breaks stuff a lot!

Howto reproduce:
* Create a subdomain under a hosting package (with php fastcgi)
* be sure you change the php setting: session.save_patch to {WEBSPACEROOT}/tmp/
* create a php test file showing phpinfo(); on BOTH main domain and subdomain.
* compare both test.php files output. You will see that on the mainwebsite the php variable "Loaded Configuration File" is filled with /var/www/vhosts/xxxxxx.com/etc/php.ini but on the subdomain it shows: /etc/php.ini

Result SHOULD return:
The session.save_patch in phpinfo(); should show something like this: /var/www/vhosts/xxxxxxxx.com/tmp/

Actual result
But under subdomains it's showing: "/var/lib/php/session"

I tested this on a Plesk 11 installation not older then 1 month. More people who can confirm this?
 
Little update:
I tested it on a new (installed yesterday) and empty server but it seems there is no problem on this new server.
 
Ignore my previous comment. I have this problem on ALL servers I have tested it now! Frustrating!
 
Can you create a php.ini for each of the sub domains as well, or are they stuck using the system ini file?
 
What do you mean exactly? When a subdomain is created in the /var/www/vhost directorie it does contains a correct etc/php.ini file.
 
Sorry. What I was wondering is if the sub domains are not inheriting the ini file from the domain, are they able to have their own created that use the same settings, or are the sub domains forced to use the system ini?
 
Hi,

I have a similar problem to that in this thread and (I think) the one at http://forum.parallels.com/showthread.php?t=209780:

I am using Plesk Panel 10.3.1 and trying to run PHP on a domain and its subdomains as a FastCGI application. In the file /etc/php.ini (the server-wide configuration file, as outlined at http://download1.parallels.com/Ples...inistrator-guide/index.htm?fileName=69696.htm), I have set

upload_max_filesize = 20M


Say I have a domain called mydomain.com, with a php.ini file in

/var/www/vhosts/mydomain.com/etc/php.ini

As a test I have copied that file to /var/www/vhosts/mydomain.com/conf/php.ini (as outlined in the knowledgebase page at http://kb.parallels.com/111697 and http://download1.parallels.com/Ples...administration-guide/index.htm?fileName=69310), set

upload_max_filesize = 21M

within that file and changed the domain settings within Plesk so that PHP runs as an Apache module or CGI application, then changed it back to run as a FastCGI application.


If I now run a php script in that domain (e.g. www.mydomain.com/phpinfo.php) which includes a call to phpinfo(), I can see that upload_max_filesize is set to 21M, and the server-wide value is being overriden.


However, if I have a subdomain demo.mydomain.com, and create another php script within it which also calls phpinfo(), I see that the value of upload_max_filesize is set to 20M (as per the server-wide settings).

Copying the php.ini file which set the upload_max_filesize to 21M into

/var/www/vhosts/mydomain.com/subdomains/demo/etc
or
/var/www/vhosts/mydomain.com/subdomains/demo/conf

doesn't appear to do anything either (phpinfo() still outputs an upload_max_filesize of 20M).

Really, this is related to the fact that I want to set the session.save_path for the domain and all of its subdomains to /var/www/vhost/mydomain.com/private/php_sess as outlined in the knowledgebase page at http://kb.parallels.com/en/7056 (upload_max_filesize was just an example for testing). I see that the page refers to upgrading Parallels Plesk Panel to version 10.4. Is this an issue that was fixed in version 10.4? If so, can you please advise how to update to 10.4? The Icon in my Plesk Panel at Server > Tools & Utilities > Panel > Updates cannot open the relevant page (and the 'this article' link within the accompanying text 'If the Updater page does not open in a new browser window or tab, refer to this article.' only leads to the same url).

As the php.ini file I found in /var/www/vhosts/mydomain.com/etc/php.ini included a setting for

open_basedir = /var/www/vhosts/mydomain.com/httpdocs:/tmp

perhaps I don't actually want the php.ini file created for a domain to be inherited by its subdomains, but how do I create a php.ini for each subdomain?

Thanks,

David
 
Back
Top