cronjob on php giving a 500 internal error

TechBill

Well-Known Member
Aug 7, 2011
57
5
58
When a cronjob is execute on a php script, it give an error

Status: 500 Internal Server Error
Content-type: text/html; charset=UTF-8

I joined the chatroom of that script and they tried everything to figure out why it doing this but we could not come up an answer.

This cronjob error was occuring on a server at my work which is cPanel on CentOS7. (I am only a client on this one)

I happen to have my own private host which is exactly the same the WHM/cPanel on CentOS7 (WHM because I am also server admin and I have 30 clients on it)

I compressed everything from my work server and copied it over on my private host which have the same setup .. I even use the same cronjob string on my private server. It worked every time without an 500 error.

Something on that server is causing the 500 error and I can't for the life of me figure out what is causing it. Nothing is reported in the logs other than "500 internal server error"

Have anyone experience this error and what did you do to fix it?

Thank you
 

quietFinn

Well-Known Member
Feb 4, 2006
2,042
553
493
Finland
cPanel Access Level
Root Administrator
Something on that server is causing the 500 error and I can't for the life of me figure out what is causing it. Nothing is reported in the logs other than "500 internal server error"
In what logs?
I believe you'd see more than that in /etc/apache2/logs/error_log

My 1st guess would problem with permissions.
 

TechBill

Well-Known Member
Aug 7, 2011
57
5
58
In what logs?
I believe you'd see more than that in /etc/apache2/logs/error_log

My 1st guess would problem with permissions.

On this work server, I don't have access to that error log.

Could there be a limit number of cron job per cPanel defined by WHM administrator? I never seen that setting in my private host WHM but I never really explored all the options in it either.

My first thought would be permission and when I checked, it was set at 755 which I believe is the correct permission setting.
 

TechBill

Well-Known Member
Aug 7, 2011
57
5
58
Even with file on 644 still give the same error .. On my private server, 755 executes it fine.

Is there a setting in WHM that my work server could have enabled to prevent or disallow cron jobs?
 

andrew.n

Well-Known Member
Jun 9, 2020
983
363
63
EU
cPanel Access Level
Root Administrator
You should open a ticket with your hosting provider which has access to the logs and could let you know the exact reason for the error you are seeing.
 
  • Like
Reactions: cPanelAnthony