Cronjob php file not running on ubuntu

September 10, 2015 1.9k views

Hello ! I have a problem with the cronjob file on my droplet ! I have uploaded a website on my server ( ubuntu with lamp installed) , that site is now running on a domain on a shared hosting with Cpanel and I want to transfer it to my droplet but first I need to be sure that the script it works on my new server so I don't have any problem with my site script , but when I try to run manually the cron job script on my browser by typing http://mydropleip/cron_job.php I see a blank page where is write this : #!/usr/bin/php which is not an normal thing , and the script is not working ! The crontab is working on my server I checked it and it works ! The only think that is not running is that cronjob script ! I think I need to install something else on the server but I don't know what ? That cronjob is crucial for my website ! I really don't know what I am doing wrong !
Thanks in advance !

4 Answers

If crontab is working, then it must be something within your cronjob.php. What is it suppose to do? Or what is the cronjob.php? Need more information...

The cronjob.php it supposed to get a list from an xml API and it works just fine on the shared hosting that I used till now but here just don't work and I can't figure out where is the problem ! Thank you !

Do you get any errors when you try to run it manually from the command line? Please post the crontab line.

Try marking the file as executable:

sudo chmod +x /path/to/cron_job.php

Thank you for the answer kamaln7 !
I made it executable but still not running I don't get any error when I run it manually only that it doesn't doing his job ! The strangest thing is that everything was just fine till I moved my site here :( !

Have another answer? Share your knowledge.