Page 1 of 4

Updating Error

Posted: Mon Dec 10, 2018 8:57 pm
by SphiderSnow
Having to finally make that leap to PHP 7. Had been putting it off due to Sphider, so it was great to come across the continue development done here.

I was trying to get things installed and updated but ran across a problem when trying to get the tables updated. Got a duplicate key error so it failed (see image below).
Capture.JPG (19.19 KiB) Viewed 10675 times
Is there some way to resolve this issue without having to flush my DB and start over from scratch?

Re: Updating Error

Posted: Tue Dec 11, 2018 12:48 am
by captquirk
Be happy to help you. Couple of questions first...
What version of Sphider were you running? The original 1.3.6??
Which version did you download?

The error indicates a duplicate key entry, which is probably a data error. Once I know what we are going from and what we are going to, I may have some ideas.

(BTW, posts are monitored as a way of keeping out the spam. Nothing appears until I read it first. If it isn't garbage, it WILL appear! Just had someone create a user id and post a piece of pornography a week ago. No one ever saw it. He lost that game!)

Re: Updating Error

Posted: Tue Dec 11, 2018 1:15 am
by captquirk
Use the below code to create a new php file. Name it something like 'diagdb.php' and put in in the admin directory. Then run it from a browser. This should tell us how far the updating got before it puked.
$settings_dir = "../settings";
require "$settings_dir/database.php";
$result = $db->query("SELECT version_nr FROM `".$mysql_table_prefix."settings` WHERE id = 1");
$row = $result->fetch_row();
echo $row[0];
IF you are running a PDO version, replace the second to the last line with:
$row = $result->fetch(PDO::FETCH_NUM);

Re: Updating Error

Posted: Tue Dec 11, 2018 1:20 am
by SphiderSnow
I am running 1.3.5 (not sure why I never bumped to 1.3.6).

I downloaded the 2.2.0 which uses MySQLi and MySQLnd.

My database includes a few sites as I built it around a blog that has been around for nearly 15 years, but I did not want to have to re-index the whole site each time there were some new posts to include.

Re: Updating Error

Posted: Tue Dec 11, 2018 1:23 am
by captquirk
Don't blame you!

I just have to know where we are first, then we can most likely resolve the problem with a few sql scripts. I just need to know where you have ended up at (hence the short script I provided). Once we have the database where we want it for the Sphider code to work, we can go about resolving the data issue.

Re: Updating Error

Posted: Tue Dec 11, 2018 3:14 am
by SphiderSnow
Now it seems to have gotten through

Update the database to the latest version.
You already have the latest version installed

Although that seems a bit too good to be true. I say that because the functionality does not work nor does the admin area.

I had to roll back to PHP 5.6 to keep things working earlier with my old install. It still seems to be working even though the database is updated, which is why I think something else might be at play.

My PHP is handled through cPanel, so it is also possible that I need to select some PHP extension that is not loaded already to get things to work properly. I am not getting any useful error codes. Is logging to error_log on by default?

Starting to wonder if a clean install might not be the best route. Load it, new DB, just reindex and then migrate to it.


Re: Updating Error

Posted: Tue Dec 11, 2018 4:24 am
by SphiderSnow
So in the interim I have tried to do a fresh install but in running the install.php script I do get an error

PHP Parse error: syntax error, unexpected '.' in admin/install.php on line 23

Re: Updating Error

Posted: Tue Dec 11, 2018 4:25 am
by captquirk
When you say your "old install", do you mean the 1.3.5 version? I'd be surprised it would work with the new database!
Can you post a snapshot of the settings tab?

Do you have 1.3.5 and 2.2.0 BOTH installed in separate directories but pointing to the SAME database? (That actually would work as long as you only used one at a time.)

Now, if you are using 1.3.5, and 2.2.0 won't function. Then the 'mysqlnd' extension may be lacking in PHP 7. Some hosts do that, especially if you are on shared hosting. From PHP 7, run this script:
Look for a section titled 'mysqlnd'. If it is absent, you may have to use the PDO edition. If so, not a major problem.

Let me know. I can practically guarantee you can run a newer Sphider and PHP 7.

Re: Updating Error

Posted: Tue Dec 11, 2018 4:33 am
by captquirk
OMG! You found a typo in the newest 'install.php'!! :oops:

Okay. Edit 'install.php'.
See where it says:
Replace that with:
$settings_dir = "../settings";
I'll have to update the zip file so that doesn't happen again to someone else.

Re: Updating Error

Posted: Tue Dec 11, 2018 4:52 am
by SphiderSnow
So yeah, I was trying to run from separate directories to the same database. My current setup actually had that for a couple of different language version setups I needed to do for my site, so I just added a third with pointers to the same database. However, for all that to try and work I needed to be on PHP 5 since old sphider would not work otherwise. I did look at the phpinfo and the needed extension you mentioned was there.

I think I will leave the old install in place and try a fresh install tomorrow with the corrected install.php and see how it goes.