Install xampp PHP extension memcache on ubuntu16.04

Source: Internet
Author: User
Tags zts zend

I. Objective situation:

The 1.ubuntu comes with a PHP7 environment and the project is running in a problematic condition.

2. Online Search method for php5, no memcache extension, I do not pretend

3. There are many other extensions that are not installed

Two. Human Factors:

I am a small white, white to php5 a memcache extension will not

Three. resolution Process

Ubuntu comes with a button installation is very good:

One click to install the lamp service (execute the following command at the terminal):
sudo tasksel install Lamp-server
One click to uninstall lamp (execute command at terminal):
sudo tasksel remove Lamp-server
Uninstalling the lamp from the above command will inevitably unload the Linux system itself, so you must remember to use the following when you uninstall the Lamp.
Order to update the system:
sudo apt-get update
sudo apt-get upgrade

Removed the Ubuntu php7 environment, installed phpstudy is also very good software, but on my Computer Apache installation failed, due to time constraints, must quickly set up a good environment, so did not go to study what happened (more importantly, my ability is not), Take me one hours, that's when it's almost crying.

finally, the integrated environment XAMPP is Selected.

After some toss, xampp installed, the last of the poor Memcache.

Anyway is twists, finally installed, here will not wordy.

Four. Knowledge learned

1.php extension Memcache in the directory after unpacking the tar package, there is no configure file, to Phpize after the

2.phpize,phpize is used to extend the PHP module, through the phpize can resume PHP plug-in module

3. When using phpize, in the extended directory, you will not find Config.m4--->cannot find config.m4.

4.phpize needs autoconf,autoconf need M4

5.php installation must follow this order, otherwise many pits zlib, freetype, libxml2, libpng, libgd2

FIVE. Error Notification and resolution

Execution:./configure--enable-memcache--with-php-config=/usr/local/php/bin/php-config--with-zlib-dir

1. Error: cannot find Autoconf. Please check your autoconf installation and the $PHP _autoconf environment variable are set correctly and then rerun this SC Ript. (it is here that I struggled for a long time, or English not T_t)

Solve:

1 wgethttp//ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz2 Tar-ZVXF m4-1.4.9.Tar. GZ3CD m4-1.4.9/4./configure && make&& make Install5Cd.. /6 wgethttp//ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz7 Tar-ZVXF autoconf-2.62.Tar. GZ8CD autoconf-2.62/9./configure && make&& make Install

2. error:/home/memcache-3.0.8/memcache_pool.c:26:18:fatal error:zlib.h: no file or directory

This situation is not caused by the zlib library, which is what I said not in order to leave the pit, but I am xampp no way

Under Ubuntu I apt-get install zlib in tab two.

The final implementation is Apt-get install zlib* selected several, tube him, first set up the environment to say

Solution: Apt-get Install zlib*

or, Install the source package, I didn't try Here.

Installation reference:

Http://www.cnblogs.com/yangxia-test/p/4195222.html

Copy here:

Installation Environment: CentOS 6.4

PHP extension memcache to support the memcached database cache server, The following is the installation Method.

1. download

: Http://pecl.php.net/package/memcache

File Name: memcache-3.0.8.tgz

Upload files to/usr/local directory after successful download

2. installation

[[email protected] local]# tar-zxvf memcache-3.0.8.tgz
[email protected] local]# STRONG>CD memcache-3.0.8
[[email protected] memcache-3.0.8]# /usr/local/php/bin/phpize
Configuring For:
PHP API version:20131106
Zend Module API no:20131226
Zend Extension API no:22013 1226
[[email protected] memcache-3.0.8]# ./configure--enable-memcache--with-php-config=/usr/ Local/php/bin/php-config--with-zlib-dir
[[email protected] memcache-3.0.8]# make
[[email protected] memcache-3.0.8]# make install
Installing shared extensions :/usr/local/php/lib/php/extensions/no-debug-zts-20131226/
[[email protected] memcache-3.0.8]# ll /usr/local/php/lib/php/extensions/no-debug-zts-20131226/

Total 2140
-rwxr-xr-x. 1 root root 453766 Dec 17:44 memcache.so
-rwxr-xr-x. 1 root root 861055 Dec 16:47 redis.so

The presence of memcache.so indicates that the installation was Successful.

3. Configuration support PHP

[email protected] memcache-3.0.8]# vi +/usr/local/php/lib/php.ini
Add to
Extension=memcache.so
: wq! #保存退出

4. Restart Service

[email protected] memcache-3.0.8]# /usr/local/apache2/bin/apachectl Restart
View Phpinfo to see the supported

Memcache (i was here to Download)

Http://pecl.php.net/package/memcache

feelings, the environment is really bumpy twists and turns, it was replaced by the Windows system, and then installed a phpstudy result has a problem, re-installed or not, all kinds of uncomfortable. finally, I switched back to Ubuntu. He's still old enough to crash T_t.

Their poor is really not 1:30 point, a qualified PHP programmer is still a lot worse, before always follow the online command copy and paste, very little to understand his meaning.

After careful study, and about php-config I probably looked, configure should be based on this file to go to the extension (. so file) to the corresponding directory, about this file also need to learn in Depth.

Work also has more than a year, for their own language or know so little, I feel very ashamed, to learn a lot of things, here to their own refueling! (^ω^)

Install xampp PHP extension memcache on ubuntu16.04

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.