Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Per directory php configuration changes with fcgi and no .htaccess

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

  1. mwaterous

    mwaterous Member

    Sep 19, 2010
    Likes Received:
    Trophy Points:
    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

    Oct 2, 2010
    Likes Received:
    Trophy Points:
    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/ location. If you put the directives there, you would be able to test if they check in and work by running:

    /scripts/ensure_vhost_includes --user=username
    For the above, please note that username is the cPanel username, 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:

    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110214
    /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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice