Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Linux
|
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2004, 07:44 AM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cron with PHP + XML

Hi Guys,

I am on the verge of giving up with crontab! Please help!

Ok, I have a php file which when visited in a web browser works fine. The page parses Xml using Xsl and then adds the info to a MySql database.

My problem is when I try and add this to the crontab.

The line I have come up with is….

1 * * * *
/usr/local/bin/php /home/httpd/vhosts/###.co.uk/httpdocs/xmlcron/DBcurrentstatus.php

With my binary php build at /usr/local/bin/php and the full path to file being /home/httpd/vhosts/###.co.uk/httpdocs/xmlcron/DBcurrentstatus.php.

This doesn’t work and doesn’t report any errors.

Using Shell, from the root, if I type in the line (without the 1****) should it work? I get the error message “Could not open input file /home/httpd/vhosts/###.co.uk/httpdocs/xmlcron/DBcurrentstatus.php.”

If I then try and su to the /home/httpd/vhosts/###.co.uk/httpdocs/xmlcron/ folder I can’t as I get ‘persmission denied’ when trying to enter ‘httpdocs’.

I am logged in as the default user ‘###’ while the file is on the ‘###.co.uk’ virtual host. (of the server)

I think I have one of two problems…

1. Either permissions are insufficient for cron to run /home/httpd/vhosts/###.co.uk/httpdocs/xmlcron/DBcurrentstatus.php.
2. Or there are problems because my php uses xsl/xml.

I get the following error message when trying to run the page using wget from shell…

###@######.co.uk $ wget http://67.19.218.114/67.19.218.115/#...rentstatus.php
--07:35:25-- http://67.19.218.114/67.19.218.115/#...rentstatus.php
           => `DBcurrentstatus.php'
Connecting to 67.19.218.114:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
DBcurrentstatus.php: Permission denied
Cannot write to `DBcurrentstatus.php' (Permission denied).

I have my own server but the hosts aren’t being very helpful. Any help is much appreciated.

Thanks,
Dan




 
Old October 22nd, 2004, 09:26 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey, Dan,

Sorry if I'm being daft - is the file on your local machine, or at your webhost?
i.e. is there a file called /home/httpd/vhosts/###.co.uk/httpdocs/xmlcron/DBcurrentstatus.php on the machine that you're physically in front of.

If that is the case, you could chmod 755 to make it world executable. You'll need php and the xsl stuff installed on your machine for it to run, and you may need to be root to do it.

If the file is on your webhost, you could do something like lynx --dump http://your_server_name/path/to/DBcurrentstatus.php > ~/my_page_output to grab the output, and put it in your home directory.

Either way it sounds like crontab isn't the problem.

Good luck.

--
Don't Stand on your head - you'll get footprints in your hair. http://charlieharvey.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Job mani_he Linux 4 December 16th, 2010 07:02 AM
DB cron jobs ss2003 PHP Databases 1 September 14th, 2004 03:56 PM
Cron job error ganesh15 Linux 1 October 22nd, 2003 04:04 AM
Cron job for a php-file nineball9 PHP How-To 2 October 21st, 2003 04:58 PM
Cron Job... Urgent ganesh15 Linux 2 September 19th, 2003 01:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.