Custom php.ini when using Fast-CGI

Discussion in 'General' started by orasis, Nov 8, 2013.

  1. orasis

    orasis Member

    I've been using suPHP for some years and I am used to be able to use a custom php.ini for specific directories by adding some code in an .htaccess file in that directory. I got no idea how to do something like this while using Fast-CGI and I would like to know how this can be done.

    The reason I want to switch to Fast-CGI is mainly performance although suPHP has proved excellent so far.

    Now this is not a need that can be done through ISPConfig, once I do not only need it to specify a php.ini for a whole website, but for subdirectories of a website.

    If anyone can help with an elegant and secure way of doing this I would really appreciate it.

    Thanks guys !
    cheers
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    PHP ini options can't be put in .htaccess or apache directives when using fast-cgi, sorry.
     
  3. orasis

    orasis Member

    thanks Croydon,

    ..well I am not saying to put php.ini options in .htaccess
    I am saying to use something similar to this:

    Code:
    <IfModule mod_suphp.c>
        suPHP_ConfigPath /var/www/clients/client1/web9/private/php54/php.ini
    </IfModule>
    
    when using suPHP this can be set in .htaccess
    any way around this but when using Fast-CGI ?
     
  4. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    No, the only way is to configure a separate php.ini for every website (ISPConfig offers a text field for this under website -> option tab - only admins!).
    What you wrote is an apache directive, that is not possible when using fast-cgi.

    Fast-CGI is started separate from apache and apache only forwards requests to this running processes.
     
  5. orasis

    orasis Member

    Yes I know and this can work for a whole website but you cannot have different php.ini settings for a subdirectory of that website and deeper. I know my english is not good once not my native and I know my descriptions can be confusing.

    I've seen somewhere on the net some solutions on this, similar to this one:
    http://www.ndchost.com/wiki/cpanel/custom-php-ini-fastcgi

    ..but I do not really like them. Would you just stick with suPHP ? I like the performance benefits of fast-cgi especially the fact that keeps the page into ram.

    What do you suggest ?
    thanks
     
  6. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    If you need per-directory php settings, you have to stick with suphp.
    It's not possible with fast-cgi. The link you posted is a per-website solution, just like the built-in function of ISPConfig offers.
     
  7. orasis

    orasis Member

    thanks my friend, I appreciate
     

Share This Page