Jump to content

Recommended Posts

Posted (edited)

Well i asked here and got what i thought was the answer to my problems, However it seemed not as if i ran my photo insertion script manualy it inserted the photo's to my data base as it should, But when the cron job did it nothing was inserted.

 

 

So i have done some research and because the php server api is apache and not cgi i had to do a different cron.

 

the one i had was..

 

/usr/bin/php -q /home/your_cpanel_name/public_html/path/to/script/script.php

 

 

This ran once an hour and basicaly buggered it up.

 

I have subsequently found that to run a succesfull cron job using apache i have to use...

 

 

lynx -dump http://www.mysite.com/path/to/the/script/script.php

 

and this now works.

 

I hope this may be helpful to some people who are in need of a script running automaticaly using a cron.

 

 

Perhaps this could be included in a FAQ somewhere as it took me a long time to find what i needed...

Edited by dwayne dibbly
Posted

I'm glad you found a solution to run your script. Depending on how the script was written would determine the method of running it. The /usr/bin/php example you gave is the proper way to run a script on the server.

 

Using lynx -dump is calling the script as a brower would and not the same.

Posted
Using lynx -dump is calling the script as a brower would and not the same.

Not to mention that the last I heard, access to command line browsers (such as lynx) was supposed to be removed from all servers.

 

If your script has to be called through a browser, TCH-MikeJ described the proper method for doing this (same forum topic as linked above), using a second script to call your script with a PHP include.

  • 2 months later...
Posted
Not to mention that the last I heard, access to command line browsers (such as lynx) was supposed to be removed from all servers.

 

If your script has to be called through a browser, TCH-MikeJ described the proper method for doing this (same forum topic as linked above), using a second script to call your script with a PHP include.

 

 

Thanks for the advanced notice of turning it off (NOT) it wasnt untill i had people telling me photos were not appearing that i had a look and you turned it off 4 days ago.

 

Still not to worry looks like i will try that other way you told me about but it would have been nice to have been warned.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...