PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Troubleshooting

Reply
 
Thread Tools
Old 01-31-2005, 09:21 AM   #1
kzant
Green Mole
 
Join Date: Jan 2005
Posts: 6
command line exec() pulls wrong file (php as cgi?)

Hi. Thanks for a great product, and for such a helpful forum. I've got phpdig up and running. Instead of running the indexer for the whole site, I want to index each document as it is added/edited to the site by a web-based administrator.

As such, I'd like to use the exec() command within php and index the file as its edited or added.

I've tested the following command via shell and it worked beautifully.

Quote:
/usr/bin/php -f /path/to/admin/spider.php http://www.site.com/document.doc >> /path/to/spider.log
I check spider.log and see the output of the spider text.

However, when I call from a php script as such:

Quote:
exec(/usr/bin/php -f /path/to/admin/spider.php http://www.site.com/document.doc >> /path/to/spider.log, $out);
It actually indexes the admin page that calls the exec command, not the document http://www.site.com/document.doc

My php is set to run as cgi - I'm sure this has something to do with it and there is some environment variable that I'm missing.

Any advice is appreciated.

Thanks.
kzant is offline   Reply With Quote
Old 01-31-2005, 10:53 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Perhaps try one of the following...
Code:
// save output in spider.log
exec("/usr/bin/php -f /path/to/admin/spider.php http://www.site.com/document.doc >> /path/to/spider.log");

// save output in $out variable
exec("/usr/bin/php -f /path/to/admin/spider.php http://www.site.com/document.doc",$out);
__________________
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-01-2005, 07:14 AM   #3
kzant
Green Mole
 
Join Date: Jan 2005
Posts: 6
oy

okay, well fixed that. but its still digging the upload/edit script page and not the document that's being uploaded.
Quote:
exec("/usr/bin/php -f /path/to/admin/spider.php http://www.site.com/document.doc >> /path/to/spider.log");
Thanks for your prompt response.
kzant is offline   Reply With Quote
Reply

Thread Tools

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
How to add a site from the command line or with a php script ciaran@clissman How-to Forum 1 07-18-2005 03:59 PM
PHP as CGI Edomondo Troubleshooting 3 02-05-2005 01:32 AM
spider from command line twanoo Troubleshooting 3 01-14-2005 10:04 AM
Spider.php is killed at the command line bforsyth Troubleshooting 2 12-05-2004 01:09 PM
indexing from command line with text file Wayne McBryde Troubleshooting 8 01-12-2004 05:56 PM


All times are GMT -8. The time now is 08:55 AM.


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