Asked  7 Months ago    Answers:  5   Viewed   38 times

php -v gives this

PHP Warning:  PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning:  PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match in Unknown on line 0
bogus test name tests/

ps. i've upgraded from php 5.2 to 5.3. before this everything worked okay.

 Answers

46

When you update the version of PHP (especially when going from version X.Y to version X.Z), you must update the PHP extensions as well.


This is because PHP extensions are developped in C, and are "close" to the internals of PHP -- which means that, if the APIs of those internals change, the extension must be re-compiled, to use the new versions.

And, between PHP 5.2 and PHP 5.3, for what I remember, there have been some modifications in the internal data-structures used by the PHP engine -- which means extensions must be re-compiled, in order to match that new version of those data-structures.


How to update your PHP extensions will depend on which system you are using.

If you are on windows, you can find the .dll for some extensions here : http://downloads.php.net/pierre/
For more informations about the different versions, you can take a look at what's said on the left-sidebar of windows.php.net.

If you are on Linux, you must either :

  • Check what your distribution provides
  • Or use the pecl command, to re-download the sources of the extensions in question, and re-compile them.
Wednesday, March 31, 2021
 
pocketfullofcheese
answered 7 Months ago
24

It looks like you're trying to install an extension compiled for PHP 5.3 with PHP 5.4; the module API version needs to match the version of PHP.

If you download the precompiled MongoDB PHP driver from Github (eg. php_mongo-1.2.12.zip is the current stable version) it includes DLLs for multiple PHP versions (eg 5.2, 5.3, and 5.4). You need to copy the correct DLL for your system and rename it php_mongo.dll.

You can determine the required version from the phpinfo() output on your system (or php -i from a command line). Check the value for "Zend Extension Build".

For example:

Zend Extension Build => API220100525,NTS,VC9

.. would indicate you should use the NTS (Non-threadsafe) DLL.

On 64-bit Windows, that would mean copying php_mongo-1.2.12-5.4-vc9-nts-x86_64.dll to php_mongo.dll in your PHP extension directory.

Saturday, May 29, 2021
 
Nil
answered 5 Months ago
Nil
32

http://windows.php.net/download/

  • Download the zip file for VC9 x86 Thread Safe (which is for PHP run as Apache module).
  • Extract the contents of the zip somewhere
  • Stop apache
  • Backup the php.ini file you have in your current PHP directory ../php5.3.0/
  • Delete (or backup) the rest of the contents you have in ../php5.3.0/
  • Place the extracted content in ../php5.3.0/
  • Put php_mongodb.dll in ../php5.3.0/ext/
  • Put php.ini back also
  • Restart Apache

edit:
Sorry, I forgot to mention that you also need to replace your apache install with the one from apachelounge as well, and have Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed, as per the remarks in "Which version do I choose?" on the same page http://windows.php.net/download/

Saturday, May 29, 2021
 
rlanvin
answered 5 Months ago
59

I solved the problem, Solution is connection url without tcp:// ,so session.save_path should be

session.save_path = "127.0.0.1:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
Saturday, May 29, 2021
 
Yarin
answered 5 Months ago
98

Memcached, not Memcache. Same as the name of the class.

session.save_handler = memcached

EDIT since the OP indicated that it was just a typo.

There are some similar stories here:
http://www.dotdeb.org/2008/08/25/storing-your-php-sessions-using-memcached/
http://phpslacker.com/2009/03/02/php-session-clustering-with-memcache/

Did you say "yes" when the installer asked you "Enable memcache session handler support?"

If it doesn't work, try the new Memcached extension (with the D). It's supposed to be better somehow.

Wednesday, August 25, 2021
 
nasty
answered 2 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :