CENTOS7 installation php+memcached Simple record

Source: Internet
Author: User
Tags apcu configuration php install php php memcached git clone

1) Install PHP under CENTOS7

Need to add a Yum source to install PHP-FPM, you can use Webtatic (this yum source is a bit slow for the domestic network, of course you can choose other yum sources) [[email protected] ~]# RPM-UVH https:/ /MIRROR.WEBTATIC.COM/YUM/EL7/WEBTATIC-RELEASE.RPM installation of PHP7-FPM and some other necessary components [[email protected] ~]# yum-y Install PHP70W-FPM php70w-cli php70w-gd php70w-mcrypt php70w-mysql php70w-pear php70w-xml php70w-mbstring php70w-pdo Php70w-json PHP70W-PECL-APCU php70w-pecl-apcu-devel Complete, check to see if PHP-FPM is installed properly [[email protected] ~]# php-vphp 7.0.25 (CLI) (Built:oct 13:43:03) (NTS) Copyright (c) 1997-2017 the PHP groupzend Engine v3.0.0, Copyright (c) 1                                   998-2017 Zend Technologies configuration php-fpm[[email protected] ~]# vim/etc/php-fpm.d/www.conf.....user = Nginx Change users and groups to Nginxgroup = Nginx.....listen = 127.0.0.1:9000//php-fpm The port being monitored is 90 00......env[hostname] = $HOSTNAME//Remove the following lines of comment env[path] =/usr/local/bin:/usr/bin:/binenv[tmp] =/tmpenv [TMPDIR] =/tmpenv[temp] =/TMP creates a session path in the/var/lib directoryNew folder and set the user name and group to nginx[[email protected] ~]# mkdir-p/var/lib/php/session[[email protected] ~]# chown nginx: Nginx-r/var/lib/php/session/[[email protected] ~]# ll-d/var/lib/php/session/drwxr-xr-x. 2 nginx 4096 January 09:47/var/lib/php/session/start Nginx and PHP-FPM service and add boot start [[email protected] ~]# Systemctl St Art php-fpm[[email protected] ~]# systemctl enable PHP-FPM

1) Install the PHP memcached Extension module

You need to install the dependent library libmemcached[[email protected] src]# wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/ Libmemcached-1.0.18.tar.gz[[email protected] src]# tar-zxf libmemcached-1.0.18.tar.gz[[email protected] src]# CD libmemcached-1.0.18/[[email protected] libmemcached-1.0.18]#./configure && make && make After installing the install dependent Library, we install memcached: after cloning memcached from GitHub, you need to manually switch to the PHP7 branch, otherwise you will be prompted with an error: Fatal Error:ext/standard/php_smart_ Str. H:no such file or directory error. [[email protected] src]# git clone https://github.com/php-memcached-dev/php-memcached.git[[email  Protected] src]# CD php-memcached/[[email protected] php-memcached]# git checkout php7[[email protected] php-memcached]# phpize [[email protected] php-memcached]#./configure--DISABLE-MEMCACHED-SASL-- With-libmemcached-die=/usr/local/libmemcached[[email protected] php-memcached]# make && make install[[ Email protected] ~]# Find/-name memcached.so/usr/lib64/php/modules/memcached.so/usr/local/src/php-memcached/.libs/memcached.so/usr/local/src/php-memcached/ Modules/memcached.so[[email protected] ~]# vim/etc/php.ini......extension=/usr/lib64/php/modules/ Memcached.so[[email protected] ~]# systemctl restart php-fpm[[email protected] ~]# php-m....memcached

Install php+memcached simple records under CENTOS7

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.