• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Max execution time problem

OsmanD

New Pleskian
Hello,

I have a cronjob via a php file. It takes nearly 15 minutes to complete the process. But I have a problem about the max_execution_time. I get the following message or Internal Server Error.

Fatal error: Maximum execution time of 60 seconds exceeded

I want to set max_execution_time to 1000 seconds. But when I try to do it via .htaccess or php code in a php file ini_set('max_execution_time', 1000), it doesn't work. I think the server gets this value from default configuration file, which I don't have permission to change.

My site default setting is like below.
max_execution_time : 60
session.auto_start : off
session.cache_expire : 180


When I try to set max_execution_time in plesk Php Settings,

Additional configuration directives I get the following message :
ini_set("max_execution_time",1000)

When I save the configuration I get the following message :

Error: phpinimng failed: Cannot parse php.ini: (<class __main__.PhpIniSyntaxError at 0x2acd1bb40350>, <__main__.PhpIniSyntaxError instance at 0x2acd1bb42ef0>)

1- Is there a way, to set max_execution_time without changing server default settings?

2- If I asked my hosting company to change the value, does such a long time for max_execution_time cause vulnerability or does it decrease site speed?

3- Are max_execution_time and session timeout the same things? :)

4- Why don't php code or htaccess setting work?

(My site has a membership system. Several members can log on at a time.)

Thank you for your answer.
 
This almost sounds like you are running a shared environment (versus a VPS or a dedicated server) in which case it is unlikely that you may be able to change those settings.

Are you running PHP via Apache or FastCGI? (The answer determines the best course of action) - If you're running FastCGI part of the answer is changing the value of https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidiotimeout

To answer your other question regarding security/decreasing site speed, I've never heard of an instance where increasing a script's processing time inherently caused a security issue however it can create performance problems since runaway scripts or heavy traffic loads could hog threads to the point where a site becomes inoperable.
 
I'm running php via Apache. Actually, I use a VDS server. But I think my hosting company doesn't let their clients to reach every settings in case of improper use.
Do you think I should ask my hosting company to change the settings? I still can't understand why any settings don't work via a php file or .htaccess.
 
Do you actually have access to the server via SSH or a VZPP environment? If you don't, are you running on a shared plan that just happens to use Plesk?
 
I don't have access via SSH or VZPP. But as I know, one server only belongs to my site. Because I can restart or shutdown the server via Plesk.
 
Back
Top