Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    3

    Default Using FastCGI + special php.ini directives for a Directory

    Hi all

    We're running suPHP and are experience performance issues with suPHP not scaling well when load raises above a certain level.

    Therefore, we considered changing from suPHP to FastCGI.

    However the different applications we have sometimes require that we override the global php.ini directives with specific ones in a special directory/application.

    We have for example:
    - a legacy app that needs register_globals on
    - an app that produces PDFs and needs maximum_memory set to 100M

    With suPHP : we would just put a php.ini file in the directory with the configurations we wanted to override and everything works fine.


    With fastCGI : this approach does not seem to work. We can't even set different php.ini configurations per account.
    With fastCGI enabled it seems to only read and respect the global php.ini


    What I wanted to ask is if there is any way to have a different php.ini file on specific directories.

    I have come across this info but I am unsure how it will co-exist with Cpanel:
    ( from mod_fcgid - Apache HTTP Server )
    Code:
    PHP wrapper script - /usr/local/bin/php-wrapper
    #!/bin/sh
    # Set desired PHP_FCGI_* environment variables.
    # Example:
    # PHP FastCGI processes exit after 500 requests by default.
    PHP_FCGI_MAX_REQUESTS=10000
    export PHP_FCGI_MAX_REQUESTS
    
    # Replace with the path to your FastCGI-enabled PHP executable
    exec /usr/local/bin/php-cgi
    In my case, we don't want to override PHP_FCGI_MAX_REQUESTS but would like to use
    /usr/local/bin/php-cgi -c "custom php.ini for this folder and subfolders" or -d "setting=abc" instead of -c

    Is this possible and will it work in a Cpanel configuration?

    In Cpanel it seems FastCGI is configured and enabled globally through WHM...

    Thank you very much and Best Regards
    Pedro.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,301
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Using FastCGI + special php.ini directives for a Directory

    It is possible to setup individual php.ini files using the steps noted in this tutorial:

    http://forums.cpanel.net/f5/individu...gi-160398.html
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Fastcgi (Fcgid) and php.ini per user
    By speckados in forum cPanel and WHM Discussions
    Replies: 14
    Last Post: 12-12-2011, 10:21 PM
  2. Where and how? Apache directives and priorities (proxy / php)
    By fruitwerks in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-20-2010, 10:53 AM
  3. Replies: 4
    Last Post: 05-26-2009, 05:08 PM
  4. Override php.ini directives
    By mehrdad abed in forum New User Questions
    Replies: 3
    Last Post: 06-03-2007, 09:06 AM
  5. PHP Extensions Directory - and editing php.ini
    By jl1 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-05-2005, 09:20 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube