Tuesday, June 19, 2018

[Fixed] How to install Memcache in XAMPP, on window 10 successfully

[Fixed] How to install Memcache in XAMPP, on window 10 successfully



Note- after days investing in debugging and research, finally I found that why my installation was not success.

If you are facing these kind of issue-
1.       Fatal error: Class 'Memcache' not found (or) Fatal error: Call to undefined function memcache_connect()
2.       PHP Warning:  PHP StartupUnable to load dynamic library 'php_memcache.dll' (tried: C:\xampp\php\ext\php_memcache.dll (%1 is not a valid Win32 application.)       
3. Or simply you are new to memcache then follow one by step.



Follow these steps- 

1.   Run phpinfo() in your XAMPP.
2.   See, Compiler and Architecture.



    Now search TS, or NTS, you will get one atlist. In my case I found 
    Zend Extension Build = API320170718,TS,VC15

    This mean, We need Memcache of VC15 32 bit and TS (thread safe version).
    (if a package is NTS then it will mention explicitly otherwise not)

    Now once you find your right file name, go here and download-



Go to ext folder and copy php_memcache.dll and php_memcache.pdb 
Restart the server and refresh phpinfo() page.

Now Search Memcache. If you can see a block, then you have won the battle.














Copy the sample code from this link- https://github.com/sudhir600/php-memcache-testing-script
Create a php page called test.php and paste code.
navigate test.php. If you don’t see any error that mean your installation process has been completed successfully and go rock.