1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

[BUG] Site php.ini is ignored under subdomains

Discussion in 'Plesk Suggestions and Feedback' started by LinqLOL, Oct 16, 2012.

  1. LinqLOL

    LinqLOL Basic Pleskian

    13
    60%
    Joined:
    Aug 4, 2012
    Messages:
    77
    Likes Received:
    1
    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?
     
  2. LinqLOL

    LinqLOL Basic Pleskian

    13
    60%
    Joined:
    Aug 4, 2012
    Messages:
    77
    Likes Received:
    1
    Little update:
    I tested it on a new (installed yesterday) and empty server but it seems there is no problem on this new server.
     
  3. LinqLOL

    LinqLOL Basic Pleskian

    13
    60%
    Joined:
    Aug 4, 2012
    Messages:
    77
    Likes Received:
    1
    Ignore my previous comment. I have this problem on ALL servers I have tested it now! Frustrating!
     
  4. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    Can you create a php.ini for each of the sub domains as well, or are they stuck using the system ini file?
     
  5. LinqLOL

    LinqLOL Basic Pleskian

    13
    60%
    Joined:
    Aug 4, 2012
    Messages:
    77
    Likes Received:
    1
    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.
     
  6. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    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?
     
  7. DaveyM

    DaveyM New Pleskian

    10
     
    Joined:
    Jan 21, 2013
    Messages:
    1
    Likes Received:
    0
    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
     
Loading...