• 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

php script hangs server

C

codesmith

Guest
Hello,

This isn't directly a Plesk question but since y'all are my favorite *nix support team.... :)

While developing PHP scripts occasionally a script will go out of control, endless loop, etc. This is bringing our server to it's knees - loads of 45 or higher, sometime necessitating a manual reboot. Is there anything that can be done to 'throttle' apache so it times these out or not so much processing time goes to this?

Thanks....
 
There was a thread at WHT which dealt with a similar problem.

Not sure if one of those suggestions will help you.
 
two possible reasons:
1. php bug.
2. flaw in the script

but regarding reason 2, i think php would disable the script after a certain amout of time leading me to think reason 1 is the problem.

upgrade to the latest version of php...
if that doesn't help, or you already have the latest, then submit a bug report.

perhaps this will help you knock down the dam instead of trying to pump the water over it...
 
Hmm I let this go and now I'm back at it. An endless loop on a PHP script definitely jumps the load on the server way high and I pretty much have to restart Apache to stop it.

We have
max_execution_time=90
and memory_limit=32M

to handle larger file uploads and Gallery stuff (thumbnail processing).

I don't know why the max_execution_time is being ignored - the scrips go on forever. We are running safe_mode off but the script itself isn't overriding that. Apache Timeout is set to 300 seconds but can't tell if it should timeout something like this.

Any other idears?
 
Oh yea, it is a very old post. But my question fit in here.

I wrote a php script for scrap a website and save some data to a file. Unfortunately i get a 504 Gateway-Timeout. That's not the problem, but i saw that the file will bigger and bigger. That means that the script was still running.

Did I miss something in the Plesk settings or is it on purpose? I always thought apache also terminated php handlers.
 
Back
Top