Gossamer Forum
Home : General : Internet Technologies :

PHP CRONJOB

Quote Reply
PHP CRONJOB
Hi,

I got a small problem and I have searched the website on PHP CRON and every site I go to has the same info that does not work.

I need to run a file every min or so and the file lets say is mycronphp.php. I am told to run the php but my hosting company does not have php installed as cgi so I can't run

**** /usr/bin/php -q /home/usr/http/site/mycronphp.php >/dev/null

It also seems that my php is php3 or php4 and the path is at /usr/ports/lang/php4 but to this I have no access as if I try to run this it says access not allowed.

I have tried to run by using lynx, fetch, wget and still can't get the fill to do what is needed.

**** /usr/bin/fetch -o /dev/null http://foo.com/mahc/mycronphp.php 1>/dev/null 2>/dev/null

**** /usr/bin/lynx -dump http://foo.com/mahc/mycronphp.php >/dev/null

Wget would be the same as lynx, so where am I going wrong? Can anyone help on this?? Now the above crons work for others and I can't understand why they don't work for meCrazy
rexxx webmaster
Quote Reply
Re: [rexxx] PHP CRONJOB In reply to
Try this:Cool

/usr/bin/lynx -source "http://foo.com/mahc/mycronphp.php?log=cron"
Quote Reply
Re: [Suomi] PHP CRONJOB In reply to
Don't work at all.



Thanks anyway
rexxx webmaster
Quote Reply
Re: [rexxx] PHP CRONJOB In reply to
Are you sure you have Lynx installed? I'm using;

/usr/bin/lynx -dump -something http://www.ace-clipart.com/topsite/new/cron.php?mode=rerank\&word=word >/dev/null

That works fine for me ;)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy.] PHP CRONJOB In reply to
Yes I do when I do a whereis lynx I get /usr/local/bin/lynx

The error I get is

Looking up
www.foo.com

Making HTTP connection to
www.foo.com

Alert!: Unable to connect to remote host.

lynx: Can't access startfile
http://www.foo.com/mahc/mycronjob.php
rexxx webmaster
Quote Reply
Re: [rexxx] PHP CRONJOB In reply to
Are you on Red Hat or something else? Some distributions of linux don't seem to let lynx browse sites on their own server.

The alternative is to download and install the PHP binary from php.net, add #!/usr/bin/php -q

to the top of the script, chmod 755 and then just run it by typing ./file.php and setting up a cron script that way.
---------------------------------------------
DeskPRO.com http://www.deskpro.com?r=gt
vBulletin.com Moderator and Support http://www.vbulletin.com/
Quote Reply
Re: [padders] PHP CRONJOB In reply to
Yes running php as cgi would be nice but I am on a system right now that I am not sure if I can do this php3 and php4 are in the path but I don't seem to have access to them. I am requesting our tech dept to make it so.
rexxx webmaster