PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Troubleshooting

Reply
 
Thread Tools
Old 02-07-2004, 02:50 PM   #1
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
Unhappy spider.php via bash

hello together,

i'm trying to start the spider-process via shell - but nothing happens - so i read all articles concerning this in the forum.

but nothing works!

/usr/local/bin/php4 -f /phpdig/admin/spider.php http://www.domain.com >> phpdigg.log

when i take the -w switch(instead of -f) i see the code from spider.php => this tells me all paths are ok
several other scripts run without problems from shell and cron

but spider.php won't :-(

sending the command=>new prompt=>but nothing happens

please help :-)
tomas is offline   Reply With Quote
Old 02-07-2004, 02:55 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Try this and then let me know what's in the phpdigg.log file:
Code:
/usr/local/bin/php4 -f /phpdig/admin/spider.php http://www.domain.com > phpdigg.log 2>&1
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 02-07-2004, 03:02 PM   #3
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
the same as it ever was :-)

hello charter,

this is the fastes response i ever got - thanks

content of logfile:
X-Powered-By: PHP/4.2.3
Content-type: text/html
tomas is offline   Reply With Quote
Old 02-07-2004, 03:04 PM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. What does the following produce?

CD to the admin directory and then do the following:
Code:
php -f spider.php http://www.domain.com > phpdigg.log 2>&1
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 02-07-2004, 03:11 PM   #5
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
you're the best !

hi charter,

great!
no i hope it will run for the next 7 hours and index all sites.


thanks in advance
tomas from germany
tomas is offline   Reply With Quote
Old 02-07-2004, 03:36 PM   #6
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
but one question remains,

when calling the script with cron i need the full path
from root :-(
tomas is offline   Reply With Quote
Old 02-07-2004, 03:43 PM   #7
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. If you are following this tutorial, and you place everything in the admin directory, then you can use the following to spider on the 1st and 15th of every month:
Code:
0 0 1,15 * * php -f spider.php cronlist.txt > phpdigg.log
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 02-07-2004, 03:49 PM   #8
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
Question

hi charter,

ok - i try this out - but why does it not
work with the full path - i do this with some
other php scripts and they work fine???
tomas is offline   Reply With Quote
Old 02-07-2004, 03:54 PM   #9
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Full path to PHP or other scripts?
Code:
0 0 1,15 * * /full/path/to/php -f /full/path/to/admin/spider.php cronlist.txt > phpdigg.log
What OS are you using?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 02-07-2004, 04:00 PM   #10
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
full path to other scripts
debian
won't i loose all other cronjobs in my crontab
doing it like the tutorial?
tomas is offline   Reply With Quote
Old 02-07-2004, 04:11 PM   #11
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. The command first posted was the following:
Code:
/usr/local/bin/php4 -f /phpdig/admin/spider.php http://www.domain.com >> phpdigg.log
Was /phpdig/admin/spider.php the full path to spider.php? Perhaps try /usr/local/bin/php or just php instead of /usr/local/bin/php4 in the command.

I'm not all that familiar with Debain, but with Linux you can set a number of cronjobs up to the limit imposed by a host. Perhaps try setting a test cronjob that prints some text to a file and see if it removes the PhpDig cronjob.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 02-07-2004, 04:33 PM   #12
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
yes - as i thought this overwrites the existing crontab from the logged user -
but charter - why all this ???
a lot of other scripts called by crontab work fine
why can't i call this from my user directory this way like all the others:
5 * * * 1,2,3,4,5 /usr/local/bin/php4 /homepages/22/d86961/htdocs/cron/rep_01.php > /dev/null
tomas is offline   Reply With Quote
Old 02-07-2004, 04:42 PM   #13
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. How many other cronjobs do you have running? Maybe you are at your limit, but I'm guessing not. One thing is that the config.php file has the following code:
PHP Code:
if ((isset($relative_script_path)) && ($relative_script_path != ".") && ($relative_script_path != "..")) {
  exit();

This code was implemented for security reasons. If the $relative_script_path from shell is different than dot or double dot, then the process will exit. If this is the case, just add the relative path needed in the above code.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 02-07-2004, 04:58 PM   #14
tomas
Orange Mole
 
Join Date: Feb 2004
Posts: 47
gotcha -
this is the troublemaker:
doing this:
/*
if ((isset($relative_script_path)) && ($relative_script_path != ".") && ($relative_script_path != "..")) {
exit();
}
if (eregi("config.php",$_SERVER['SCRIPT_FILENAME']) || eregi("config.php",$_SERVER['REQUEST_URI'])) {
exit();
}
*/

now it runs
tomas is offline   Reply With Quote
Old 02-07-2004, 05:11 PM   #15
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Glad it's now working, but you don't want to comment that section out. It was added for security reasons, and unless you are running locally (no other person has access) then that is opening you up to a world of trouble! Rather you need to allow for the relative path in the code, the same as was done for dot and double dot.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
spider.php blocked when indexing acti_dev External Binaries 9 12-09-2006 06:29 AM
spider.php problem digdug Script Installation 8 10-18-2006 08:25 AM
autorefresh spider.php zaartix Mod Requests 0 12-21-2005 10:11 PM
I have one bug with spider.php Booboo Troubleshooting 1 03-01-2005 02:46 AM
sleep(5) in spider.php? bsw114 How-to Forum 2 03-12-2004 02:31 PM


All times are GMT -8. The time now is 06:47 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.