Page 1 of 1

PHP4 PHP5 Switching now cannot log into SQL Server

PostPosted: 28. March 2008 01:27
by Melza
Hi,

This is my very first post in a forum EVER! So be gentle.

I am trying to switch between PHP5 and PHP4. I used the switch bat and everything was great, worked well until I tried to log into myPHPAdmin whilst running PHP4.

I entered username and password then I got an error that says Cannot Log into the MySQL Server

The username and password works fine when I switch back to PHP5.

Is there something else I need to change?

I am using the latest version of xampp 1.6.6a.

Thanks

Switch to php 4 changes MySql version!

PostPosted: 13. May 2008 16:27
by macview
I am having a similar issue. But I have noticed after installing Xampp with it's defaults (PHP5) all looks good, set up of password etc. Switch to php4 and all goes wrong - can't log into phpMyadmin - At first I thought it was the pass word issue but now there is something more to it.

If I re-install putting in NO password for MYsql THEN switch to PHP4, I can get into phpMyadmin. BUT look at the MYSQL version in top corner - 3.23.49! How did that happen? It was running MYsql version 5 before the switch - IF it's running a different version of MYSQL then adding the pass word to MYSQL (Via xampp security) breaks the phpMyadmin access.

SO looking at the bottom of phpMyadmin it says in a warning "Your PHP MySQL library version 3.23.49 differs from your MySQL server version 5.0.51a. This may cause unpredictable behavior." Why it did this I don't know. I will see if I can fix this and post back the result.

PostPosted: 14. May 2008 11:50
by ifokkema
Make sure the mysqli module is loaded into PHP4... the 'i' stands for improved (thus, newer MySQL versions).
HTH (Hope this helps),
Ivo

mysqli file

PostPosted: 14. May 2008 14:22
by macview
Okay, in the main php.ini file there is no call to extensions for loading any .dll files BUT there is in the php4 and php5.ini files (and the there is no reference to mysqli.dll only mysql.dll in those) There is a libmysqli.dll file in the php4 folder itself.

SO the question is; should I be moving some files around and setting the extension load in a particular php.ini file?

Re: mysqli file

PostPosted: 14. May 2008 14:29
by ifokkema
macview wrote:SO the question is; should I be moving some files around and setting the extension load in a particular php.ini file?

I don't think you need to move files around, but adding a line to the php.ini file that already loads the mysql.dll to also include the mysqli.dll should work...

No change

PostPosted: 14. May 2008 20:04
by macview
I believe it is loading now (if I take mysqli.dll out, the error log will show it missing) but there is no change to the error in PHPmyadmin and the MySql version still says 3.23.49 instead of 5.0.51a. I will keep trying things to see.

PostPosted: 15. May 2008 08:25
by ifokkema
how many libmysql.dll files do you have spread over your hard drive? Maybe PHP is picking the wrong one...

PostPosted: 15. May 2008 10:20
by sari42
iirc the mysql extension uses 3.23 functionality if it can't load any libmysql. Try and copy the latest libmysql.dll from, e.g., apache\bin into the search path (usually "system32"). You also could try the mysqli extension. There also was a controluser related bugfix lately, see http://sourceforge.net/tracker/index.ph ... tid=377408 "(ok 2.11.5) Mysql Server and Client version mismatch"

PostPosted: 15. May 2008 11:53
by Wiedmann
Make sure the mysqli module is loaded into PHP4...

mysqli is only available for PHP5, not for PHP4.

and the MySql version still says 3.23.49 instead of 5.0.51a.

The mysql extension is a static build-in extension in PHP4. For PHP4 builds the MySQL client libraries 3.23.49 is used. And because it's static build in you can't change this. (In PHP5 this is a shared extension).

php4

PostPosted: 15. May 2008 13:59
by macview
So is it something I should just ignore if were using php4?

We're running XAMPP 5.5 on our current machines with php4 and MySql shows properly (as version 5) and was hoping to update all to a new machine but if only if there is no issues with this.

So if you can tell me this is just a false reading and we ARE in fact running Mysql 5 under php4 and it should work as usual, that would be great.

PostPosted: 15. May 2008 14:55
by Wiedmann
So if you can tell me this is just a false reading and we ARE in fact running Mysql 5 under php4 and it should work as usual, that would be great.

You must distinguish:
- You are running MySQL server version 5.x.x
- PHP4 is using the MYSQL client version 3.x.x

(The client must not be the same version as the server. Of course, it's better to have the same... that'S what phpMyAdmin is telling you)

Thanks

PostPosted: 15. May 2008 16:36
by macview
Thanks for the clarification - this helps, Thanks again.