php.ini max_execution_time limiting no overrides

Discussion in 'PHP' started by kjavitz, Mar 19, 2013.

  1. kjavitz

    kjavitz Member

    I'm trying to disable clients from being able to set max_execution_time via php using:


    or .htaccess using:

    php_value max_execution_time

    In php.ini I changed the following lines:
    safe_mode_protected_env_vars = max_execution_time
    disable_functions = set_time_limit

    but I want to make sure it's working the phpinfo shows:
    local max time 1800 and master value 30 so which ones is it using? Did I adjust php.ini correctly?
  2. webizen

    webizen Well-Known Member

    you can disable .htaccess.


    put "php_admin_value max_execution_time xx" in httpd.conf to disallow override.
  3. kjavitz

    kjavitz Member

    Is there some way to disable local overrides of certain settings besides the httpd.conf method? Also people should not be able to override this in their own php.ini either.

    Is there an easier way? I can't disable .htaccess as people need it for other things. I use WHM and went to service configuration > apache configuration > includes editor and tried all 3 of the ones it has there which are:
    I put in the textarea box:

    php_admin_value max_execution_time 30

    and when I try and save it it says:

    Sorry, your changes have introduced a syntax error in pre_main_global.conf. Please correct the issue.
    Configuration problem detected on line 1 of file /usr/local/apache/conf/includes/pre_main_global.conf.tmp: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration --- /usr/local/apache/conf/includes/pre_main_global.conf.tmp --- 1 ===> php_admin_value max_execution_time 30 <=== --- /usr/local/apache/conf/includes/pre_main_global.conf.tmp ---
    Clearing pre_virtualhost_2.conf

    Clearing pre_virtualhost_global.conf
    Last edited: Mar 1, 2016
  4. NiteWave

    NiteWave Administrator

    if apache enable mod_php module, it should be able to recognize php_admin_value
    but usually on shared host, mod_php is not used since php will run in non-suExec mode.
    but litespeed can recognize php_admin_value / php_value / php_flag / php_admin_flag.

    please try
    <IfModule litespeed>
    php_admin_value max_execution_time 30
    see if those error will be gone.

Share This Page