0

So, a while back I was looking at how to make them, got it just about figured out, and then found out with 000webhost you can only link to files in your website, and couldn't write a command line thing

I couldn't find much info on this, as in most people seemed to have a cron.php or something similar, but I haven't been able to find any examples that involve a database and stuff

I've made a page with the code I want, that will run fine when you load it, but I've added it to the cron jobs and nothing happens. The line looks like this - 0 0 * * * php -f /home/-my id-/public_html/indeximages.php

What must I do differently on the page to make it work with cron jobs? Or should it be working and it's a dodgy server or something?

  • Make sure it isn't just an environment problem, which is a very common cause for cron problems difficult to diagnose if one is not aware of this. Read this answer (Ask Ubuntu) for more information. – Daniel Andersson Jan 20 '14 at 9:48
  • Thanks, it looks like you need more control to edit or even check that though, as 000webhost literally only lets you point towards files inside your directory – Peter Jan 20 '14 at 22:35
0

If your PHP script is designed to be executed from a command-line, it should work as you have it implemented currently. However, if it is meant to be run by way of pointing a web browser to it, you will need to use a web browser like elinks or w3m to hit the PHP script via HTTP.

  • wget would also work – Brian Adkins Jan 20 '14 at 3:02
  • Hmm thanks, well I included the html code so the page can load, but the php code shouldn't actually need it, if I remove all unnecessary bits so there's only the important code left, would that work, or would I basically need to look up php for command lines and write a new one from scratch? – Peter Jan 20 '14 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.