Jump to content

[Solved] 500 Internal Server Error


petervaien

Recommended Posts

Hi,

when I run a PHP script which could last up to 5 minutes, making so many times PGSql DB calls, it gives me "500 Internal Server Error" after a while (30sec/1minute) and stops running :

 

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@XXX.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

No error logstracked.

Is there maybe a limit on PHP script duration?

I would otherwise need 10 cronjob slots instead of only 2 : how can I get them, please? Each would run a single atomic PHP script as a part of the bigger one which now gives me an error..may I ?

 

Please let me know.

Thank you.

Link to comment
Share on other sites

A script needing those kinds of resources or run times is almost certainly too heavy be hosted here. The server error is because php has an execution time limit on it. If php didn't exit on you and give the server error, you'd probably end up suspended for load instead.

 

You can use a tool like setcronjob.com to set more than 2 crons, and you'll need to limit the php runtime to 30 seconds or it will just exit on you and make apache spit out a 500.

 

I'd recommend setting those 10 crons to run over the course of a day or two to help with load (e.g. do one step of your 10 every 4 hours). Running it all at once could get you suspended if its really that heavy that it needs this kind of time to run.

Link to comment
Share on other sites

  • 2 months later...

500 errors when using cpanel are normal due to the process limit. Accounts are limite in how many processes they can run, and cpanel opens a lot of them when you log in. As a result, apache can't open php to run your site, and spits out that error.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...