PDA

View Full Version : cmd line path?


digitalbart2k
04-29-2004, 09:31 AM
I am unable to index from the command line unless I switch to the directory in which spider.php is contained

this will work when I am in the /search/admin/ directory:

php -f spider.php http://www.domainname.com >/tmp/output 2>/tmp/erroroutput


this won't

/usr/bin/php -f /web/servers/domainname.com/search/admin/spider.php http://www.domainname.com > /tmp/phpdigg.log 2>&1

or this

php -f /web/servers/domainname.com/search/admin/spider.php http://www.domainname.com >/tmp/output 2>/tmp/erroroutput

I want to schedule a cron job so I will need the full path I assume.
Any ideas?

Charter
05-01-2004, 08:59 AM
Hi. If you wish to call spider.php from a directory other than the admin directory, you need to edit the first if statement in the config file so that it allows for the different path, that path being a relative and/or full path UP TO but NOT including the admin directory - no ending slash.

blowfish
06-02-2004, 12:16 AM
Originally posted by Charter
Hi. If you wish to call spider.php from a directory other than the admin directory, you need to edit the first if statement in the config file so that it allows for the different path, that path being a relative and/or full path UP TO but NOT including the admin directory - no ending slash.

Ah, that did the trick!
I had the same prob, but after this config.php revision with adding the absolute path (RaQ 550 server running Linux), it now works from any dir I'm in via SSH.

This is what worked for the command line (all on one line),
[root admin]# php -f /home/.sites/28/site1/.users/91/lists/web/search/admin/spider.php /home/.sites/28/site1/.users/91/lists/web/search/admin/cronlist.txt >> /home/.sites/28/site1/.users/91/lists/web/search/admin/spider.log

Now will be checking out the cron by adding to the front:
2 3 * * *
so it'll update 3:02am every day, every week, every month

lighthouse
08-03-2004, 07:51 AM
Originally posted by Charter
Hi. If you wish to call spider.php from a directory other than the admin directory, you need to edit the first if statement in the config file so that it allows for the different path, that path being a relative and/or full path UP TO but NOT including the admin directory - no ending slash.


Charter - can you give an example of who you do this... I've tried - but getting no where... In the end I just commented out the first if statement altogether to get this to work, but I'm guessing this isnt advisable!

LH

Charter
08-03-2004, 12:31 PM
http://www.phpdig.net/showthread.php?threadid=1106 ;)