PDA

View Full Version : Local install just not spidering


sealless
01-24-2006, 06:18 AM
I've been going through this forum over the past two days looking for a solution to my problem. So far I haven't found it. Here's my situation:

I have installed phpdig in a WAMP set up : Apache running on a Win 2K box with php and MySQL of course. Installation was without incident. Spidering... well that never works. Regardless of URI entered I get the same immdiate results

Spidering in progress... [Stop spider]
Optimizing tables...
Indexing complete !

Nothing except an entry in the tempspider table. I get the same results if the URI is http://localhost/some/uri, and if it is some external URI, http://www.somewhere.com. I figured this can't be so hard, right? and so I uploaded the phpdig to my domain.... and it works fine with the same exact configuration. Spiders like crazy, search results are as expected. So at least I know I am not completely losing it.

Anyway... is there something really basic that I am missing with my local configuration? I am at a loss to explain why it works remotely but not locally (and I really need to use it locally).

sealless
01-24-2006, 07:47 AM
oops - I forgot to add :

Apache 2.0.55, php 5.0.5, MySQL 5.0.15 and phpDig 1.8.8.

sealless
01-25-2006, 08:25 AM
First some more clarification:

The remote system where everything was working:

php 4.3.11
MySQL 4.1.14

Now as to the source of the problem : admin/robot_functions.php,
function phpdigGetSiteFromUrl


if ($pu['port'] == 0 || $pu['port'] == 80) {
$pu['port'] = '';
}
else {
settype($pu['port'],'integer');
}


Seems harmless enough. But eventually $pu['port'] gets used in this query


$query = "INSERT INTO ".PHPDIG_DB_PREFIX."sites SET site_url='$url',upddate=NOW(),username='".$pu['user']."',password='".$pu['pass']."',port='".$pu['port']."'";


Field port in the sites table is defined as smallint and when you try to executed this query in MySQL 5 you get this message

#1366 - Incorrect integer value: '' for column 'port' at row 1

In MySQL4 the row is inserted with a value of zero for the port, no questions asked. That's why it worked on my remote host but not on my local PC. I would presume this is a "bug" but it could also just be some MySQL configuration issue that can be resolved without a change to the code. In my case I am going to make this quick and dirty change


if ($pu['port'] == 0 || $pu['port'] == 80) {
$pu['port'] = 0;
}
else {
settype($pu['port'],'integer');
}

to get by.

Charter
02-03-2006, 03:06 AM
Good spot. :)

Haven't had a chance to test PhpDig on MySQL 5, thread stuck.

bugmenot
02-04-2006, 07:33 AM
Thank you for sorting this bug out. Your fix did the trick for me!