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.

Per directory php configuration changes with fcgi and no .htaccess

Discussion in 'General Discussion' started by mwaterous, Feb 11, 2011.

  1. mwaterous

    mwaterous Member

    Joined:
    Sep 19, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    NV
    Here's the problem in a nutshell: I have my server set up with PHP running as fcgi. I am trying to move all configuration for a particular site to the actual httpd.conf (via includes, of course) and disable the use of .htaccess entirely.

    However PHP only reads in the php.ini it finds in the cgi-bin/ for that account. It won't read individual php.ini files on a per directory basis. There is one directory where I need to turn output compression off, while leaving it on everywhere else. I cannot use php_flag within <Directory> due to running fcgi. I also cannot upgrade to PHP 5.3 in order to use .user.ini files as a few older versions of Magento running on the server will choke (if you've ever tried upgrading Magento, you know why I'm not bothering).

    Is there any way to set per directory php configuration directives running PHP 5.2.16 under Apache 2.2 fcgi, *without* using .htaccess?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Have you tried using includes for the user for this? Without .htaccess, the only thing I can think would be includes at /usr/local/apache/conf/userdata/std/2/username/domain.com/includename.conf location. If you put the directives there, you would be able to test if they check in and work by running:

    Code:
    /scripts/ensure_vhost_includes --user=username
    For the above, please note that username is the cPanel username, domain.com is the domain name, and includename.conf is the name of the include file. After checking in the include, you would then rebuild and restart Apache after making a backup of it:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110214
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    If this doesn't work, please provide the exact syntax used for the include versus what you were using in the .htaccess file. I have allowed individual php.ini files via the .htaccess before, but haven't ever tried using the includes. I'm certain there is a way to get this to work.
     
Loading...

Share This Page