PHP Extensions error when installing new versions
Posted by: Todd (---.ccsleeds.co.uk)
Date: April 11, 2012 05:37PM

Hi,

After installing the latest version of Wamp (2.2, php 5.3.10, apache 2.2.21, mysql 5.5.20) everything worked fine.

I then needed to install older addons, so I went for php 5.2.9, mysql 5.0.88, apache 2.2.11, and again, everything works fine.

However, when I switch back to the initial install (and the more recent addons), I get an error when trying to connect to mysql:

PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.2.9/ext/php_pdo_sqlite.dll' - %1 is not a valid Win32 application.

in Unknown on line 0

It seems that although I have switched to php 5.3.10, it's still referencing the older addon.

I've also tried to do this with a new install, and I have the same issue.

I'm on Windows 7 64 bit (I've tried both the 64 bit installer, and the 32 bit installer).

Has anyone else had this issue?

Options: ReplyQuote
Re: PHP Extensions error when installing new versions
Posted by: RiggsFolly (---.as13285.net)
Date: April 11, 2012 05:54PM

Hi,

Are you using WAMP managers Version switching feature.

If so you will need to switch ALL of apache/mysql/php together to ensure compatibility.
If you just switch Apache its not enough. So that means you need to switch all 3 as there appears to be an incompatability somewhere in those specific releases.

Specifically it looks like you forgot to switch the PHP version back to 5.3.10.

Options: ReplyQuote
Re: PHP Extensions error when installing new versions
Posted by: Todd (---.ccsleeds.co.uk)
Date: April 11, 2012 06:01PM

Hey,

I am definitely switching all of them at once.

I've stopped all the services and switched to all the relevant versions.

Wamp says I'm on the correct versions (or, the tick is next to the correct version), and the wampmanager.conf file says I'm on the correct versions too.

Options: ReplyQuote
Re: PHP Extensions error when installing new versions
Posted by: RiggsFolly (---.as13285.net)
Date: April 12, 2012 01:24PM

OK,

So potentially you have edited the wrong php.ini file when you made one of the switches. Or switched php before apache.

Hold on to your smalls this could get bumpy!!

Apache expects a php.ini file to exists in its bin folder and of course it does using wamp.
But because you can switch PHP versions this file needs to change when you switch php versions.
Now when you use the wampmanager link to edit php.ini it edits the php.ini file in the apache/currentversion/bin folder, otherwise changes to it would not take effect when you restart apache.

So wamp has to look after this file for you.

When you switch PHP versions it needs to make this php.ini config safe so it copies
apache/currentversion/bin/php.ini into php/currentversion/phpForApache.ini hence saving it.

It then copies the php/newversion/phpForApache.ini into the apache/currentversion/bin/php.ini

Of course it also does whatever to make sure the correct php.exe is being used as well but thats not relevant now.


So I think to fix your problem you need to

Switch apache to the correct version, then switch php to the correct version. This should put the correct php.ini file into the correct apache/bin folder.
You may need to switch a few times to get it all back in line but basically switch APACHE first and PHP second.



PS.
the php.ini file in the PHP/phpversion/php.ini is only used for the PHP CLI environment ( command line php )

Hope this helps.

Options: ReplyQuote
Re: PHP Extensions error when installing new versions
Posted by: Todd (---.ccsleeds.co.uk)
Date: April 13, 2012 01:48PM

Hey,

Thanks for the detailed reply!

I've just reinstalled everything and I'm only keeping the latest version for now.

When I need the older php version again, I'll try this smiling smiley

Options: ReplyQuote


Sorry, only registered users may post in this forum.