The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP5 and local php.ini files

Discussion in 'General Discussion' started by webignition, May 18, 2007.

  1. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    I'm looking to upgrade from PHP4/CGI to PHP5/CGI and would like know if the settings in local php.ini files are still taken into account.

    I understand that this undocumented feature was removed in some releases of PHP5 but was under the impression, and I'm not sure exactly why, that this 'feature' was then re-introduced to PHP5.

    I'll be sticking with Apache 1.3.36 and will just be upgrading to PHP 5.2.x.

    In order to plan for the migration to PHP5, I've borrowed a cPanel account on a server running Apache 2, PHP 5.2.1/CGI (suphp). The first thing I noticed was that it doesn't seem to pay any attention to my local php.ini files. I'm trying to find out if this is due to PHP5.

    Any thoughts would be much appreciated!
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,380
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    In my experience with suPHP you have to add a line in the httpd.conf file:

    suPHP_ConfigPath /path/to/alternate/php.ini

    in order to get suPHP to recognize an alternate php.ini file.

    There is some additional information in the thread:

    http://forums.cpanel.net/showthread.php?t=65846
     
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Excellent news sparek - I'll take a look at what you suggest.

    I'm more interested, however, in knowing if local php.ini files will work with phpsuexec.

    Apache2/suphp is being used on the server I'm testing from, however on my own server I'll be using Apache 1.3.x/phpsuexec.

    Are you suggesting this is a suphp thing and under Apache 1.3.x/phpsuexec/PHP 5.2.x local php.ini files will work?
     
  4. pross

    pross Well-Known Member

    Joined:
    Mar 14, 2005
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    i was under the impression php dropped support for it..being a bit of a security issue..but suphp gets around it by adding that directive the the container in httpd.conf so keeping it at an admin level
     
  5. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,380
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Well actually, its not technically an admin level directive, unless this has changed within the suPHP community. You can actually add the suPHP_ConfigPath directive within a user's .htaccess. However, I agree that this really should be an admin level directive. I don't have a problem with users wanting or needing to circumvent something within the main php.ini file, but just personally as an administrative I would like to know about this. Otherwise you open the door to where you disable certain PHP functions and then any end user can just re-enable them.

    I wrote a guide on how to implement suPHP on Apache 1.3 and how to fix a few things within suPHP. One of those fixes was to disable the ability for end users to use suPHP_ConfigPath in their .htaccess files. I am not sure if the cPanel rendition of suPHP with Apache2 follows this, but I would assume that it would allow it. I'm assuming that the cPanel suPHP/Apache2 combo does not use any type of customization. I haven't had time to play with cPanel's Apache2/suPHP setup, I was waiting for the new version of easyapache (please don't get into a war of words regarding its delay, if you want to do that, start another thread) to test it.

    I believe this is something that was adopted by the PHP community. I'm not sure of its current status, I think the ability to include local php.ini files was removed in one version of PHP5, and then added back due to the high number of complaints in a later version of PHP5. Make sure you are running the latest version of PHP5 if you are having problems with this.

    I was also under the impression that things with cPanel were moving more towards suPHP. In which case the suPHP_ConfigPath (regardless of whether its an admin only directive or available in .htaccess files) would allow a way around this.

    Hope this helps.
     
  6. JamesSmith

    JamesSmith Well-Known Member

    Joined:
    Sep 17, 2003
    Messages:
    185
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK, Luton
    I have patched versions of PHP4 and PHP5 that will look for the php.ini files named as php4.ini and php5.ini if you intend to run both together, which we're doing with suphp, works very well.
     
Loading...

Share This Page