Ignored phpvalues at .htaccess, ISPconfig or PHP

Discussion in 'Installation/Configuration' started by mbria, Dec 2, 2007.

  1. mbria

    mbria New Member

    Hi all,

    One of my new sites requires some special tunning of php_values, but never mind where I set them, it didn't work.

    My server is:
    - ubuntu 7.04 (following perfect setup)
    - suPHP (following suPHP howto)
    - ISPconfig 2.2.16

    My goal is setting those variables as follows, just in one site:

    * post_max_size=100M
    * upload_max_filesize=100M
    * max_execution_time=1000
    * max_input_time=1000

    I tried at ISPconfig setting "Apache Directives" to:

    PHP:
    ...
    <
    Directory /var/www/web3/web>  
    Options +Includes +FollowSymlinks -Indexes  
    AllowOverride All  
    Order allow
    ,deny  
    Allow from all
    php_value post_max_size 500
    <Files "^\.ht">  
    Deny from all  
    </Files>  
    </
    Directory>
    ...
    And also at it's own .htaccess with multiple variants:

    PHP:
    #php_value post_max_size "100M"
    #php_value upload_max_filesize "100M"
    #php_value max_execution_time "1000"
    #php_value max_input_time "1000"
    <IfModule mod_php5.c>
    php_flag post_max_size 50
    php_value post_max_size 50
    </IfModule>
    Finally I tried directly at the CMS (it's a Drupal) config file... where other variables are set:

    PHP:
    ini_set('post_max_size',            '100M');
    ini_set('upload_max_filesize',     '100M');
    ini_set('max_execution_time',    '1000');
    ini_set('max_input_time',           '1000');
    As said, non of those solutions work.

    Any clue about how to fix this?

    Thanks a lot for your self,

    m.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not set php:admin or php_flag values with SuPHP. This is nothing ISPConfig specific, suphp uses php as cgi internally and you can never set these values for a cgi php.

    If you want to set custom values, you will have to make a custom php.ini file and set this in the apache directives (see suphp documentation for details).
     
  3. mbria

    mbria New Member

    suPHP Custom php.ini

    Thanks a lot till for the indications.

    If I understand you (and some other posts in this forum about similar issues), if I like different php.inis for each site I just need to change my "ISPconfig Apache Directives" requesting it.

    If I catch it, it means:

    PHP:
    <Directory /var/www/web3/web>  
    Options +Includes +FollowSymlinks -Indexes  
    AllowOverride All  
    Order allow
    ,deny  
    Allow from all
    php_value post_max_size 500
    <Files "^\.ht">  
    Deny from all  
    </Files>  
    </
    Directory>
    suPHP_ConfigPath /var/www/web3/etc/php.ini
    And after this:

    1) cp /etc/php5/cgi/php.ini /var/www/web3/etc/php.ini
    2) vim /var/www/web3/etc/php.ini (to include my specific changes)
    3) /etc/init.d/apache2 restart

    But unfortunately, a phpinfo I run on this site still shows default settings.

    Did I miss something?

    Sorry in advance for the newbie questions. :-(

    Thanks again for your help,

    m.
     
  4. mbria

    mbria New Member

    Funny... don't ask me why, but now it's perfectly working.

    I commented some redirection "Apache Directives" and the magic flows:

    PHP:
    suPHP_ConfigPath /var/www/web3/etc/php.ini

    RewriteEngine on
    # RewriteCond %{HTTP_HOST}   ^test.mysite.org [NC]
    # RewriteRule   ^/(.*)$ /test/$1  [L]
    # Rewrite flv files to actual file.
    # RewriteCond %{REQUEST_URI}    ^.*flv$
    # RewriteRule ^(.*)system\/(.*)$        $1$2 [L]

    <Directory /var/www/web3/web>  
      
    Options +Includes +FollowSymlinks -Indexes  
      AllowOverride All  
      Order allow
    ,deny  
      Allow from all
      
    <Files "^\.ht">  
        
    Deny from all  
      
    </Files>  
    </
    Directory>

    <
    Directory /var/www/web3/*/files>  
      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
      Options None
      Options +FollowSymLinks
    </Directory>
    Thanks a lot for your help. You can imagine how much happy am I now. ;-)

    Cheers,

    m.
     
  5. paxpacis

    paxpacis New Member

    I know this post is from 2007 but I just installed suPHP.

    Will this change the php.ini path for every website? or just web3?

    suPHP_ConfigPath /var/www/web3/etc/php.ini

    Regards.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    This changes the path onöy for the website were you added it in the apache directives field.
     
  7. paxpacis

    paxpacis New Member

    Hi Till,

    Thank you for the quick reply. I thought because this entry is before the <directory> it was a global setting.

    So just to clarify, I can add several of these

    suPHP_ConfigPath /var/www/web3/etc/php.ini
    suPHP_ConfigPath /var/www/web4/etc/php.ini

    And they will be used only by web3 and web4?

     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The content of the apache directives is only for the website were you add it! This means you can add there only things for this specific wenbsite. If you want to set a php.ini for another website, you will have to add it in the apache directives field of the other website of course.
     
  9. paxpacis

    paxpacis New Member

    Ah sorry, I missed the part that I have to make it an apache directive. It is totally clear now.. thanks again..

     
  10. paxpacis

    paxpacis New Member

    Forget this post.. please delete, when I read my own post, I saw I missed the = sign.. sorry..
     
    Last edited: Dec 16, 2009

Share This Page