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.

Apache 2 and php5 on new server

Discussion in 'EasyApache' started by peterr, Apr 23, 2008.

  1. peterr

    peterr Well-Known Member

    Joined:
    Sep 24, 2003
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    Currently moving a site to a new server, here is the info from CPanel:

    The server I used before allowed me to modify the php settings, by the use of the "php_flag" commands, however when I tried them on this new server, an error message:

    The php settings that I have needed to change in the past are these from .htaccess:

    Code:
    php_flag session.use_trans_sid off
    php_flag register_globals off
    php_flag allow_url_fopen off
    
    plus forcing any php errors to a file outside of the web root (and no php errors to the browser of course). I don't think the new server uses phpsuexec , but instead: Mod SuPHP, UniqueId, Userdir, and maybe Fileprotect.

    The settings from "EasyApache" are as follows:

    Now for some questions please.

    1. Is there any method that I can use, to place the "php_flag" commands into .htaccess ?
    2. Is modifying php.ini the ONLY method to modify the php settings ?

    I have tried a small php.ini to override one php setting, as a test, it worked okay, however my understanding of using php.ini is .........

    (i) I will need a complete copy of the current php.ini , and then modify that
    (ii) The file php.ini then needs to be in every sub-path as well, at least every sub-path that has an include statement.

    There must be an easy way to do this, after all, don't they call it "EasyApache" ? :confused:
     
  2. peterr

    peterr Well-Known Member

    Joined:
    Sep 24, 2003
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    Just noticed this from suPHP - FAQ ..

     
  3. peterr

    peterr Well-Known Member

    Joined:
    Sep 24, 2003
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    Does anyone know anything about suPHP ?
     
  4. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Put a line like this in your htaccess file..
    Code:
    suPHP_ConfigPath /home/userdir 
    
    Then create a file /home/userdir/php.ini

    Now you have a local php.ini file where you can set your directives. The syntax is a little different from what you were using in .htaccess, for example...
    php_flag register_globals off

    becomes..
    register_globals = off
     
  5. peterr

    peterr Well-Known Member

    Joined:
    Sep 24, 2003
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    Thanks, I assume I only need to specify it once, in the .htaccess of the web root, and also that there would only need to be one php.ini , that is the one in /home/userdir/php.ini

    Peter
     
  6. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    That's correct. One note of caution, doing it this way does not just add the values to your php configuration.. actually it completely negates the server-wide php.ini settings (going to some sort of built-in php default I guess) and then applies what you have in php.ini. That may not mean anything to you, but it could mean you have to put other tweaks in your own php.ini to get it back to what you had before you added your own custom php.ini. I.E. you may need to also reset things like max_upload size and error reporting.
     
  7. peterr

    peterr Well-Known Member

    Joined:
    Sep 24, 2003
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    Okay, thanks for advising on that. :)
     
Loading...

Share This Page