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.

suPHP Apache 2.2 php.ini and addon domains

Discussion in 'EasyApache' started by carock, Jun 25, 2010.

  1. carock

    carock Well-Known Member

    Joined:
    Sep 25, 2002
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    St. Charles, MO
    Can you have a separate php.ini for each addon domain in an account?

    I have a customer that need register_globals on for one of his addon domains, but putting a php.ini file in that addon domain's directory doesn't seem to work.

    Any ideas?

    Thanks,
    Chuck
     
  2. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Yes, you can have a separate php.ini for any folder(s). In SuPHP, the local php.ini overrides the global php.ini. You can put a phpinfo() page in the addon folder and check which php.ini is being loaded. You can specify the path of php.ini in .htaccess file as well.

    suPHP_ConfigPath /path/to/folder/

    You can check your current PHP handler by running this command as root.

    /usr/local/cpanel/bin/rebuild_phpconf --current
     
  3. carock

    carock Well-Known Member

    Joined:
    Sep 25, 2002
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    St. Charles, MO
    Ah, ok.

    Sorry, my bad. Your post made me realize what I was doing wrong.

    The problem is a cron job. Realizing what you said and using the phpinfo I figured out that the cron job is running a command line php, not through Apache, so Apache can't load the local php.ini for the cron job. Different context.

    I found the php CLI man page that allowed me to specify the INI file setting, or I also suggested using wget with the web address os it would run through Apache.

    Thank you very much. My brain was stuck.

    Chuck
     
  4. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    Glad you figured it out. :)

     
Loading...

Share This Page