homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

php script limitations for cron job execution
are there any?

 4:37 pm on Oct 9, 2006 (gmt 0)

I guys,
Through my plesk control panel I'm able to set up cron jobs to execute simple php scripts that send emails etc without any problems.

But I've recently had a programmer write a php script that is reading an external xml file into my database and it just isn't executing with my cron job.

If I trigger the php file through IE it runs no problem.

So I'm wondering are their any limitations in php if it is executed through a cron tab?

I was thinking script size?
database calls?
reading external xml files?

As you can probably tell I'm not the programmer but without any cue I'm kind of stuck between my host and programmer who are blaming each other.




 5:39 pm on Oct 9, 2006 (gmt 0)

Does the script use sessions? Open it up and look for $_SESSION. Also it could have to do with the permissions on the external file, try setting those to make sure the username you run the cron job from has read access.


 6:10 pm on Oct 9, 2006 (gmt 0)

thanks for those tips.
unfortunately there are no sessions and the external file (I've been told) is allowing us to read it.

I should add I just upgraded to php5 I don't know if that makes a difference.


 10:02 pm on Oct 9, 2006 (gmt 0)

Does it require input arguments like mypage.php?a=1&b=2


 5:55 am on Oct 10, 2006 (gmt 0)

the xml feed comes in from a url like this
<? set_time_limit(0);


 9:04 am on Oct 10, 2006 (gmt 0)

If a process doesn't work, it needs to be debugged.

You may look (or let your programmer look) at these things systematically:

-- did the program start at all: is everything spelled correctly in the crontab? (possible errors: wrong or incomplete path, the cron job may have a different environment than you, so the path to the script should be specified completely as /path/from/root/to/script).
-- Could the program find the external xml file? (possible errors: wrong or incomplete path, see above; to be fixed either in the cron statement if specified as argument, or within the program if hardcoded there)
-- Could the program read the file? (possible error: insufficient file permissions, the cron job may run under another user context than you locally)
-- Could the database be connected (there always is a database return codes for this)?
-- was the SQL accepted (again a database return code)?
-- are there other things to note?

Kind regards,

Global Options:
 top home search open messages active posts  

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved