Here's a look at a Linux system nginx php-fpm install PHP memcache Extension Tutorial, there are many ways to install memcache plug-ins but if you use PHP-FPM and Nginx driver php to use those sudo apt-get Install Php5-memcache may not be used.
Tell me how to configure the Memcache PHP call if you manually install PHP in a special directory.
Context reference I wrote php-fpm install that blog.
| The code is as follows |
Copy Code |
|
Cd/data1/server/php-cgi/bin |
Go to PHP installed directory bin to execute
| code is as follows |
copy code |
|
./pecl Install memcache
Downloading memcache-2.2.6.tgz ...
Starting to download memcache-2.2.6.tgz (35,957 bytes)
... done:35,957 bytes
One source files, building
W Arning:php_bin/data1/server/php-cgi/bin/php appears to have a suffix-cgi/bin/php but config variable php_suffix does n OT match
Running:phpize
Configuring for:
PHP API version:20100412
Zend Module Api no:20100525
Zend Extension Api no:220100525
Cannot find autoconf. Please check your autoconf installation and the
$PHP _autoconf environment variable. Then, rerun this script.
ERROR: ' phpize ' failed
There's nothing to wear. Start loading him.
sudo apt-get install autoconf |
showed a success.
Build process completed successfully
Installing '/data1/server/php-cgi/lib/php/extensions/no-debug-non-zts-20100525/memcache.so '
Install ok:channel://pecl.php.net/memcache-2.2.6
Configuration option ' Php_ini ' is ' not ' set to php.ini location
Should add "extension=memcache.so" to PHP.ini
Installation prompts to extension=memcache.so this sentence to join the php.ini was successful.
Test
| The code is as follows |
Copy Code |
|
<?php
$mem = new Memcache;
$mem->connect (' 211.144.xx.xx ', 11211);
$mem->set (' key ', ' This is a test! ', 0, 60);
$val = $mem->get (' key ');
Echo $val;
?> |
was not successful.