Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23

Thread: Fastcgi (Fcgid) and php.ini per user

  1. #16
    Registered User
    Join Date
    Mar 2012
    Posts
    4
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Fastcgi (Fcgid) and php.ini per user

    Quote Originally Posted by internetfab View Post
    Just a heads up - easyapache comments out

    Code:
    AddHandler php5-fastcgi .php
    from .htaccess when it's done upgrading. Just noticed this a week ago and haven't had the time to play around with it (well, except using find and replace..).

    If anyone know a workaround to this "feature" let me know.
    Thank you for this - I just upgraded using EasyApache and spent a long time checking file permissions and other settings trying to figure out why custom php.ini files with FastCGI had stopped working.. I didn't notice that AddHandler line had been commented out.

    Why does EasyApache do this? It would be good to have an options to tell it not to (or if there is one, please let me know where it is...)

    What would be really nice is a solution where we can use PHP with FastCGI but have it read php.ini files in the same way that SuPHP does, so we can just put the php.ini file in the document root, rather than having to edit .htaccess, and create and set permissions on files in the cgi-bin folder, which is hard to explain to customers.

  2. #17
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Feb 2003
    Location
    Gothenburg, Sweden
    Posts
    329
    cPanel/WHM Access Level

    DataCenter Provider

    Default Re: Fastcgi (Fcgid) and php.ini per user

    There are two solutions that we've used for this. One is easy, the other is more complicated

    1. The easy way
    If you're using php 5.3+, let users use the .user.ini file instead. It's default in 5.3+ and they can set their specific settings there using the normal php.ini syntax. Observe that not all ini settings can be set this way (check php.net which).
    If you're using 5.2 or earlier you need to install an extension from PECL (htscanner) which acts in more or less the same way. We've configured it to read .php52.ini files instead of .user.ini since it doesn't have the same syntax. It uses the php_flag / php_value syntax like .htaccess does.
    PECL :: Package :: htscanner

    2. The hard way
    Make use of cPanels apache include system to set addhandlers through an include file that gets included directly in httpd.conf. This way they're retained even after easyapache is run. Link to docs: Changes Contained within a VirtualHost Directive
    Last edited by internetfab; 07-03-2012 at 05:18 AM.

    twitter: oderland_david

  3. #18
    Member
    Join Date
    Feb 2008
    Posts
    94

    Default Re: Fastcgi (Fcgid) and php.ini per user

    Hello internetfab
    could you more elaborate on how to fix easyapache commenting out entries on .htaccess?

    we use PHP 5.3 +FASTCGI+CentOS6

  4. #19
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Feb 2003
    Location
    Gothenburg, Sweden
    Posts
    329
    cPanel/WHM Access Level

    DataCenter Provider

    Default Re: Fastcgi (Fcgid) and php.ini per user

    Quote Originally Posted by ikillbill View Post
    Hello internetfab
    could you more elaborate on how to fix easyapache commenting out entries on .htaccess?

    we use PHP 5.3 +FASTCGI+CentOS6
    There's so apparent way to stop easyapache from commenting out entries in .htaccess.
    However, if YOU are the one adding entries to your customers .htaccess file, for example AddHandler entries, then you should put them in the virtual host instead.

    You can keep changes to virtual hosts several ways, one of them is to put them like described in this document:
    Changes Contained within a VirtualHost Directive

    As an example:
    Customer Domain: cpaneltest.com
    Customer Username: cpanelte
    You're running apache 2.x and it's for non ssl

    Create a conf file:

    Code:
    /usr/local/apache/conf/userdata/std/2/cpanelte/cpaneltest.com/fastcgi.conf
    Put your AddHandler entries there:

    Code:
    AddHandler php5-fastcgi .php
    Then run:

    Code:
    /scripts/verify_vhost_includes
    After that I usually run
    Code:
    /usr/local/apache/bin/apachectl -t
    and last a restart of apache.
    Last edited by internetfab; 08-08-2012 at 06:06 AM.

    twitter: oderland_david

  5. #20
    cPanel Development cPanelKenneth's Avatar
    Join Date
    Apr 2006
    Posts
    4,125
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Fastcgi (Fcgid) and php.ini per user

    The behavior occurs when you change the PHP handler and is not dependent upon EasyApache. To influence which .htaccess files are examined and updated, please change the value of the following tweak setting:

    Depth to recurse for .htaccess checks
    Kenneth
    Product Manager
    cPanel, Inc.

  6. #21
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Feb 2003
    Location
    Gothenburg, Sweden
    Posts
    329
    cPanel/WHM Access Level

    DataCenter Provider

    Default Re: Fastcgi (Fcgid) and php.ini per user

    Quote Originally Posted by cpanelkenneth View Post
    The behavior occurs when you change the PHP handler and is not dependent upon EasyApache. To influence which .htaccess files are examined and updated, please change the value of the following tweak setting:

    Depth to recurse for .htaccess checks
    Unless this has been fixed lately, it occurred even though PHP handler wasn't changed. As you can see I'm referring to a custom handle
    Code:
    php5-fastcgi
    which lets the user / admin set up php.ini files for the virtual host in fcgid mode. This one gets commented when running easyapache.

    Would you please elaborate upon the .htaccess check tweak setting and how that would help in this case?

    twitter: oderland_david

  7. #22
    cPanel Development cPanelKenneth's Avatar
    Join Date
    Apr 2006
    Posts
    4,125
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Fastcgi (Fcgid) and php.ini per user

    Sure, here's how it is described in our documentation (http://docs.cpanel.net/twiki/bin/vie...weakSettings):

    Depth to recurse for .htaccess checks
    This item allows you to specify the maximum number of directories deep to look for .htaccess files, relative to the home directory.
    For example, if your user's home directory were /home/user, and this value were set to 2, the following directories would be searched for .htaccess files:
    /home/user/
    /home/user/directory1/
    /home/user/directory1/directory2/
    While the following directory would not be searched:
    /home/user/directory1/directory2/directory3/
    Warning: Entering a value higher than 100 can degrade your server's performance.
    (Note: after reading the above it seems that description could use some help. It provides little information on how this setting is used.)

    The setting is used by the /usr/local/cpanel/bin/rebuild_phpconf utility, which is called whenever you change the PHP handler in WHM. rebuild_phpconf calls /usr/local/cpanel/bin/update_php_mime_types with the value stipulated in tweak settings for htaccess recursion as a parameter.

    In the context of EasyApache, EasyApache assumes the PHP handler has changed. Thus it too calls update_php_mime_types with the htaccess recursion setting as a parameter.
    Kenneth
    Product Manager
    cPanel, Inc.

  8. #23
    Member
    Join Date
    May 2003
    Posts
    616

    Default Re: Fastcgi (Fcgid) and php.ini per user

    Quote Originally Posted by internetfab View Post
    Unless this has been fixed lately, it occurred even though PHP handler wasn't changed. As you can see I'm referring to a custom handle
    Code:
    php5-fastcgi
    which lets the user / admin set up php.ini files for the virtual host in fcgid mode. This one gets commented when running easyapache.
    This should solve the issue of easyapache commenting out the custom PHP handlers created by the user or the server admin:

    touch /var/cpanel/easy_skip_update_php_mime_types

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 8
    Last Post: 04-30-2012, 12:30 AM
  2. Replies: 1
    Last Post: 07-11-2011, 06:54 PM
  3. php-fcgid+eaccelerator+custom php.ini+apache2-mpm-worker= segfault?
    By internetfab in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 01-30-2011, 04:25 PM
  4. fcgid (FastCGI) and APC shared cache
    By larwilliams in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 11-05-2009, 01:21 PM
  5. 'Mod FCGID' was changed to '1' by 'Fastcgi'
    By garingas in forum cPanel & WHM Discussions
    Replies: 6
    Last Post: 11-12-2007, 08:22 AM

Tags for this Thread