Jump to content

Cronjob Not Running - Error when checking service -CentOS 7 (php) ERROR (getpwnam() failed)

Recommended Posts

This has had me and my IT stumped. Hes been busy so I need to get this fixed myself. I'm not entirely sure what is happening or how to fix it. I am very new to linux so I will try whatever you suggest but remember that I don't understand some of the terminology.


As for what I've done, I made sure the crond service was running. I ended up getting this error when restarting the service.


crond[9437]: (php) ERROR (getpwnam() failed)


What I have in the cronjob file is:


* * * * * php -q /var/www/*myhost*/public_html/crons/cron.php



Any help is appreciated.

Share this post

Link to post
Share on other sites

Corrected the issue myself. I had to specify my php path and add root as the user. So the new job looks like this


* * * * * root /usr/bin/php -q /var/www/*myhost*/public_html/crons/cron.php


Thats what corrected my error. I hope this can help someone if they have this same problem.

Share this post

Link to post
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.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated