Increase PHP execution time?

Discussion in 'General' started by crypted, Jul 16, 2010.

  1. crypted

    crypted New Member

    How would one increase the PHP execution time in the ISPCONFIG interface?

    I added the following to the website apache directives:
    php_admin_value max_execution_time = 200

    The rest of my APACHE DIRECTIVES are:
    php_admin_value disable_functions "show_source system shell_exec passthru exec phpinfo popen proc_open"
    php_admin_flag allow_url_fopen Off
    <Directory /var/www/clients/client1/web8/web/>
    AllowOverride All
    However, that did not work. Adding that decreased the default 120 to 30 seconds.

    I tried php_admin_value max_execution_time 200 and I tried php_admin_value max_execution_time "200"


    I realized that ISPCONFIG is not looking at .htaccess in the websites base directory. I had set stuff there that isn't being used.
    cat .htaccess 
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    php_value memory_limit 64M
    php_value max_execution_time 450
    How can I get either APACHE DIRECTIVES to be looked at or .htaccess OR both?
    Last edited: Jul 16, 2010
  2. damir

    damir New Member

    Are you using mod_php or fast_cgi?
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is the controlpanel and not the webserver. The webserver is apache and .htaccess files are configuration files of the apache webserver. Apache is reading the .htaccess files on a ispconfig server when you put them into a directory which is inside the vhost, e.g. in the "web" directory which is the root directory of the vhost.

    What you should check is that you have allowed apache to read these settings from a .htaccess file by setting AllowOverride to "all" on the options tab of the website settings.

    Both locations are always used by apache.
  4. crypted

    crypted New Member

    I realize ISPCONFIG isn't a webserver, but the settings I've created aren't being used by Apache.

    I'm using FAST-CGI.

    My "OPTIONS" for the website has had the "AllowOverride All" for months and it has not worked. And, I do mean where it says AllowOverride: I have ALL in the box.

    My ISPCONFIG-set Apache Directive shows:
    php_admin_value disable_functions "show_source system shell_exec passthru exec phpinfo popen proc_open"
    php_admin_flag allow_url_fopen Off
    <Directory /var/www/clients/client1/web8/web/>
    AllowOverride All
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    php_admin_value and php_admin_flag are functions of the apache module mod_php. So they work only for mod_php and not fast-cgi or cgi PHP.
  6. crypted

    crypted New Member

    Those have been in there since I used MOD_PHP, which you recommend I drop for FAST-CGI as I'm running Wordpress sites.

    I will delete those entries.

    But, I need to get the actual PHP execution time to work. So, I need to get that .htaccess actually being read.
  7. till

    till Super Moderator Staff Member ISPConfig Developer

  8. crypted

    crypted New Member

    Till I understand that and AM NOT using them any longer.

    Is there no way to override the time limit for php max execution time aside from creating a specific PHP.INI per site?

    The .htaccess entry won't work? "php_value max_execution_time 450"

    It isn't a php_admin_value.
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Some newer php versions have a .htaccess scanner extension included, personally I would never use it in a hosting enviroment as it allows the users to circumvet most security settings. So using a .htscanner extension is only an option for internal dev servers or private servers that dont allow access by clients. Thats why all Linux distributions disable it by default in php.ini. It depends on the php version (> 5.3 nescessary) and the settings that you have in the php.ini file if you can use the .htaccess scanner.

    I posted you already the Link to a better way to use custom settings with fast-cgi. So please read the bugtracker thread that I posted above.
  10. crypted

    crypted New Member

    Till, I'm not quite sure how this is to be implemented. Please help enlighten me.

    1) create /var/www/php-fcgi-scripts/

    2) copy /etc/php.ini into above directory

    3) create subdirectories webXX for all domains that will have custom php (web11, web13, web20, web39)

    4) create file .php-fcgi-starter and add the following code:
    PHPRC="<tmpl_var name='php_ini_path'>"
    export PHPRC
    PHP_DOCUMENT_ROOT="<tmpl_var name='document_root'>"
    # The variable PHP_FCGI_CHILDREN is onyl useful for lighty or nginx as apache
    # mod_fcgi will control the number of childs themself and never use the additional processes.
    # PHP_FCGI_CHILDREN=<tmpl_var name='php_fcgi_children'>
    # export PHP_FCGI_CHILDREN
    PHP_FCGI_MAX_REQUESTS=<tmpl_var name='php_fcgi_max_requests'>
    # merge main and local configuraton files
    rm -f ${FILECONF}
    cat ${PHPRC}php.ini php.ini > ${FILECONF}
    chmod 444 ${FILECONF}
    exec <tmpl_var name='php_fcgi_bin'> \
    <tmpl_if name="security_level" op="==" value="20"> -d open_basedir="<tmpl_var name='open_basedir'>" \
    -d upload_tmp_dir=<tmpl_var name='document_root'>/tmp \
    -d session.save_path=<tmpl_var name='document_root'>/tmp \
    </tmpl_if> -c ${FILECONF} $1
    5) in subdirectories, create php-local.ini files and add variables that are wanted:
    max_execution_time = 300
    max_file_size = 30M

    But, what next? How does this get inserted into the apache directives generated by ISPCONFIG?

    I'd love to see a standard guide for this.

    I did message the original poster on this process, but never heard back.

    Please, help me out. I'm sure others would love to know the step-by-step as well.
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Steps 1-3: not nescessary as these folders and the fcgi starter script are created by ispconfig when you select fcgi as php method. The only thing that you have to do is to modify the fcgi starter script master template in /usr/local/ispconfig/server/conf/ so that it matches the file in 4).

    5) yes.

    This is already implemented in ispconfig 3.0.3 as you can see in the feature request item, so there will be no guide for it as no manual changes are needed for ispconfig >= 3.0.3
  12. crypted

    crypted New Member

    True. I'll just wait for 3.0.3 since it's nearing completion. :)

Share This Page