PDA

View Full Version : cron using wget instead of php


mirdin
04-13-2004, 11:14 AM
I have PHP on safe_mode globally, but turned it off for the vhost containing phpdig.

Tried the cron with php but still got this message (even though safe_mode is off for that vhost) :
PHP Warning: set_time_limit(): Cannot set time limit in safe mode


I then tried the following cron

wget http://admin:pwd@mydomain.com/phpdig/admin/spider.php?url=http://mydomain/site.php?limit=5


That worked, the site got spidered :)

I would like to have the site indexed/updated on a weekly basis, should the above mentioned cronjob work or do I have to change it?

Also what does the "site is recently spidered" error mean? recently as in 1 hour, 1 day, 1 week? How long do you have to wait before you can spider it again?

Charter
04-13-2004, 08:12 PM
Hi. Seems PHP thinks the vhost is still in safe mode. Not sure about that, but there is a cron job tutorial here (http://www.phpdig.net/showthread.php?threadid=323). Reindex depends on define('LIMIT_DAYS',7); in the config file or a meta revisit-after tag.

mirdin
04-14-2004, 01:40 AM
Originally posted by Charter
Hi. Seems PHP thinks the vhost is still in safe mode. Not sure about that, but there is a cron job tutorial here (http://www.phpdig.net/showthread.php?threadid=323). Reindex depends on define('LIMIT_DAYS',7); in the config file or a meta revisit-after tag.


Thank you for your reply.

hmm...I stlll can't get rid off the "Cannot set time limit in safe mode " error when I use the php command
The vhost is not in safe_mode (I double checked with phpinfo(); )

Is there a problem with using the following cronjob? It seems to work so far and solves the safe_mode problem :)

/usr/bin/wget --delete-after http://admin:pwd@domain.com/phpdig/admin/spider.php?url=http://url

Charter
04-14-2004, 03:49 AM
Hi. Other than passing the username and password in plain text, it's probably not a problem.

mirdin
04-14-2004, 04:02 AM
Originally posted by Charter
Hi. Other than passing the username and password in plain text, it's probably not a problem.

Great :)

True, the username/password are passed in clear text, but as long as I use it just for my site residing on my server it shouldn't be a big security issue.
And I can restict admin access to 127.0.0.1 and my own IP.

Instead of wget I could try using curl though. I'll see how that goes.