Results 1 to 6 of 6
  1. #1

    Set PHP max execution time

    I'm running a cpanel/whm sentos server and want to know how I can limit the PHP max execution time for any script that is run on the server.

    I have tried adding "max_execution_time" to php.ini file but this does not affect the value as shown on the phpinfo() page.
    Also note: I have tried adding the above command to /etc/httpd/conf/httd.conf - still not working!

  2. #2
    Join Date
    Nov 2010
    This maximum execution time limit is set inside the php.ini file like this.

    max_execution_time = 30 ; Maximum execution time of each script, in seconds

  3. #3
    Join Date
    Apr 2008
    Don't forget to restart Apache
    Heymman - Beefy servers, tiny price !

  4. #4
    Yes this works, but how do I limit this for all users? there a global php.ini file that will automatically force every user on the server to a certain max_execution_time?

  5. #5
    Join Date
    Jun 2010
    find / -name php.ini try this command to search the php.ini
    mostly the location of global php.ini on a whm/cpanel server is /usr/local/lib/php.ini or /usr/local/php.ini
    or you can put a page in apache document root and then run the info page on browser, it will show you the path of php.ini

  6. #6
    Yes, I can add this inside /usr/local/lib/php.ini - but the problem is that any user can override the setting by simply placing a php.ini with a max_execution_time setting inside their public_html folder.

    How do I overcome this?

Similar Threads

  1. Replicating a (remote) MySQL database to improve PHP execution time
    By shought in forum Programming Discussion
    Replies: 15
    Last Post: 11-04-2010, 04:05 PM
  2. Extending Max Execution Time
    By danieljj in forum Hosting Security and Technology
    Replies: 8
    Last Post: 05-28-2009, 12:31 PM
  3. Why can't umask set execution privs on files?
    By ub3r in forum Hosting Security and Technology
    Replies: 10
    Last Post: 12-06-2007, 01:24 PM
  4. Does php comments waste execution time?
    By EthicalEpi in forum Programming Discussion
    Replies: 13
    Last Post: 01-26-2004, 05:44 PM
  5. Php Maximum execution time on UPLOAD
    By kapot in forum Hosting Security and Technology
    Replies: 5
    Last Post: 01-19-2004, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts