PDA

View Full Version : Problem running spider from Command Line


joshuag200
01-27-2004, 03:45 AM
Hello,
I try to run the spider from the command line using SSH Jailshell-2.05a$.

I am on a windows system accessing a linux server with apache.

The problem is when I run the spider it doesn't work it give no message is just give back the shell prompt and the site is not spidered.

php -f /home/user1/www/admin/spider.php http://www.testsite.com

This is the command I am typing that gives no results.

Please help
Joshua

Charter
01-27-2004, 08:05 AM
Hi. It sounds like it could be a Jailshell issue. Maybe try contacting your host and see if they allow PHP in Jailshell.

joshuag200
01-27-2004, 08:29 AM
Yes I can run PHP in Jailshell. I ran other php scripts from the command line.

Joshua

Charter
01-27-2004, 08:41 AM
Hi. Perhaps cd to the admin directory and type:

php -f spider.php http://www.testsite.com > phpdiglog.txt 2>&1

What appears in the phpdiglog.txt file?

joshuag200
01-27-2004, 09:30 AM
unable to connect to database: check the connection script.


This is what appeared in the log file.

Charter
01-27-2004, 01:55 PM
Hi. Check that the correct database information is in the connect.php file.

joshuag200
01-27-2004, 03:12 PM
Yes the correct database information is in the connect.php. The spider is running perfect from the web browser but not from the command line.

Charter
01-27-2004, 03:32 PM
Hi. The only place that the message "Unable to connect to database : Check the connection script" is generated is from the connect.php file (the _connect.php file is used by install.php to make connect.php, and connect.php is used to connect to the database). Please see this (http://www.phpdig.net/showthread.php?threadid=422) thread. It seems that either (a) Jailshell is not allowing mysql_connect or (b) the database info in the connect.php file is incorrect.

joshuag200
01-28-2004, 04:30 AM
Jail shell is allowing me to connect to MySQL from the command line. I have tried it with other scripts.

The connect.php file works perfectly from the browser so I conclude everything is find with that file.

What do you think the problem could be?

Charter
01-28-2004, 10:22 AM
Hi. The message "Unable to connect to database : Check the connection script" only comes from the connect script. The only other thing I can think of is that maybe you have two installs?

joshuag200
01-28-2004, 12:41 PM
Ok then if I have two installs how do I clear it up?

I guess I will unistall everything and installit again.

joshuag200
01-28-2004, 03:28 PM
Ok before you reply I have some information that may help you I added mysql_error() to the die part of the connect and I got the following error:

Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (2)jailshell-2.05a$

Tell me what I can do to correct this

joshuag200
01-28-2004, 07:02 PM
I got the problem fix!

In the mysql_connect (); in connect.php

I change localhost to 127.0.0.1


I read this document http://us2.php.net/function.mysql-connect

That help me a lot. I think this tread will be useful to many

WebDiva 2.0
09-03-2004, 04:49 PM
I changed localhost to 127.0.0.1 also, and now the command line works to index. I am half way there! :D

I did get this error msg now: cannot create the file in /text_content/keepalive.txt
OK, this means what? keepalive.txt already is there. Does this require chmod 777 or 666 (my default file permission is 644)

Also, I have written some new search function I will share in just a few days here. :)

Charter thank you much for this excellent work. :)

Charter
09-07-2004, 03:46 PM
Hi. Is this a path issue: /text_content/keepalive.txt versus /phpdig/text_content/keepalive.txt?

WebDiva 2.0
09-13-2004, 07:41 PM
OK. Many thanks for this. We are thinking later to use the phpdig after we have some other thing finished first. We have also your other search script, the PHP/MySQL script.

We have a books search engine and turns out some guy did put our search engine in some automated query software and now he is making many queries against the server with this.

I have thought to put the search link result into JavaScript, but so many errors I am getting. Please Charter, how does this line needs be placed in JavaScript? I have escaped quotes left and write and still no joy.

This is the line: <removed>

I thought to ask you this through the support ticket to your site, but the email we are using keeps making the codes active where you cannot read them. So this way in here is much better for that.

Charter
09-13-2004, 07:54 PM
Please do sent a support ticket for the proprietary code (i.e., not PhpDig) as these forums are for PhpDig support. Email can be sent so that it does not active itself. Thanks.

WebDiva 2.0
09-13-2004, 07:57 PM
OK. Thanks again. Yes, I will do this now. Sorry for posting it here. :)