PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Troubleshooting

Reply
 
Thread Tools
Old 03-17-2004, 04:32 PM   #1
bloodjelly
Purple Mole
 
Join Date: Dec 2003
Posts: 106
Shell mode not working

Hi -

I've been running this command fine for a while, so I know it worked at one point:



PHP:
--------------------------------------------------------------------------------

exec("/usr/bin/php -f /path/to/spider.php $site >> /dev/null &");

--------------------------------------------------------------------------------


where $site = "http://www.mysite.com/"

This worked great until I recently upgraded to a newer version of PHP, and now the command doesn't produce any results. I tried the command EXEC('WHOAMI') which worked, so I know exec still functions properly. The path to PHP is correct as well. Any ideas?
bloodjelly is offline   Reply With Quote
Old 03-21-2004, 04:35 PM   #2
bloodjelly
Purple Mole
 
Join Date: Dec 2003
Posts: 106
I figured out that the problem comes from this code in the configuration file:

PHP Code:
if ((isset($relative_script_path)) && ($relative_script_path != ".") && ($relative_script_path != "..")) { exit();

Without this line, the script runs fine. I put the exec() script in the search root directory and set $relative_script_path = '.', but it didn't work. Hmm...
bloodjelly is offline   Reply With Quote
Old 03-21-2004, 04:50 PM   #3
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
>> exec("/usr/bin/php -f /path/to/spider.php $site >> /dev/null &");

Hi. If you run spider.php from the admin directory it should be okay, but if you run spider.php from another directory, try adding ../path/to as part of that code in the configuration file.
__________________
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 03-21-2004, 05:40 PM   #4
bloodjelly
Purple Mole
 
Join Date: Dec 2003
Posts: 106
ok, it works in the admin directory. Thanks charter.
bloodjelly is offline   Reply With Quote
Old 03-21-2004, 10:57 PM   #5
bloodjelly
Purple Mole
 
Join Date: Dec 2003
Posts: 106
spoke too soon -

It's having weird problems now. It only spiders one site at a time, even when I run multiple execs, and sometimes they run after I close the browser, sometimes they don't, even when all of them are told to run in the background with the command I gave.

I'm going insane
bloodjelly is offline   Reply With Quote
Old 03-23-2004, 01:19 AM   #6
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Closing the browser does not necessarily stop a process. To guarantee the stop of a process, perhaps use kill -9 PID where PID is the process ID number. Also, when you run multiple execs, try watching the tempspider table to see if the multiple site URLs show up in the table.
__________________
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 03-23-2004, 11:09 AM   #7
bloodjelly
Purple Mole
 
Join Date: Dec 2003
Posts: 106
I've sent the question to globalservers to see what they can make of it. Redirecting the errors last night gave me this message when I tried running the exec command twice with two different urls:

"/usr/bin/php: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: Error 23"

Then pretty soon I reloaded the page enough to get this:

"PHP Warning: Unable to load dynamic library '/usr/lib/php4/ldap.so' - libldap.so.2: cannot open shared object file: Too many open files in system in Unknown on line 0"

Still I can only get one site to spider at a time. Maybe it has something to do with the redirection?
bloodjelly is offline   Reply With Quote
Old 03-24-2004, 10:13 AM   #8
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. There was another "too many open files" error reported in this thread. Maybe your errors are for the same reason? Perhaps the wrapper in this thread may be of interest.
__________________
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 04-08-2004, 05:43 PM   #9
bloodjelly
Purple Mole
 
Join Date: Dec 2003
Posts: 106
Thanks for the help, charter. The problem was with Globalservers, but as they have a tendency of doing, they fixed the problem without telling me what it was. I might try that wrapper anyway, though. Thanks again
bloodjelly 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
Problem.....sefe mode is ON xtcsoft Troubleshooting 1 07-24-2004 06:24 PM
Shell Spidering CrazyCanuck Troubleshooting 3 04-20-2004 10:56 AM
how to run spider.php in background mode 123av How-to Forum 1 04-10-2004 12:29 PM
safe mode problem Killersushi Troubleshooting 3 12-23-2003 01:27 PM
No TEMPs, No Safe Mode tyrol_gangster Mod Requests 13 11-17-2003 02:43 AM


All times are GMT -8. The time now is 10:25 PM.


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