centos7 安装apache+php+memcache
2017-07-11 11:06
267 查看
安装apache
yum install pcre-devel apr apr-devel apr-util apr-util-devel gcc-c++ libxml2-devel libxml2 perl perl-devel
./configure \
--prefix=/usr/local/apache/ \
--enable-so \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--enable-static-support
安装php
yum -y install php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd jpegsrc libmcrypt libpng libpng-devel libjpeg libxml2 libxml2-devel zlib curl curl-devel
./configure \
--prefix=/usr/local/php7/ \
--with-apxs2=/usr/local/apache/bin/apxs \
--enable-mbstring \
--with-curl \
--with-gd \
--enable-fpm \
--enable-mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-config-file-path=/usr/local/php/etc/ \
--with-mysqli=mysqlnd
cp php.ini-development /usr/local/php/etc/php.ini
报错:
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
解决步骤:
1、根据不能run apxs 。cd 到apache的bin目录下运行./apxs 运行结果
----------------------------------------------------
bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
---------------------------------------------------------
2、vim apxs文件 找“/replace/with/path/to/perl/interpreter”关键字
在第一个行 :#!/replace/with/path/to/perl/interpreter -w
根据perl的安装目录 /usr/bin/perl
修改为:#! /usr/bin/perl -w
3、运行第一步。或者直接 ./configure ^^^^^
安装memecach
第一步:安装libevent
# tar zvxf libevent-2.1.8-stable.tar.gz
# cd libevent-2.1.8-stable
# ./configure --prefix=/usr/local/libevent
# make
# make install
# cd /usr/lib64
# ln -s /usr/local/libevent/lib/libevent-2.1.so.6
第二步:安装memecached
# tar zxvf memcached-1.4.35.tar.gz
# cd memcached-1.4.35
# ./configure --prefix=/usr/local/memcached
# make
# make install
第三步:启动
# cd /usr/local/memcached/bin
# ./memcached -d -u root
第四部:测试
1.查看进程
# ps -ef|grep memcached |grep -v grep
2.查看端口
# lsof -i:11211
3.telnet测试
# telnet 192.168.6.128 11211
输入:stats
返回:
至此memecached安装成功。
配置PHP的memecached扩展
php的memcached扩展是基于libmemcached,所以要先安装libmemcached
安装libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
./configure --prefix=/usr/lib/libmemcached
make && make install
安装php-memcached-php7
./configure --enable-memcached --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/lib/libmemcached/ --disable-memcached-sasl
make && make install
重启apache
yum install pcre-devel apr apr-devel apr-util apr-util-devel gcc-c++ libxml2-devel libxml2 perl perl-devel
./configure \
--prefix=/usr/local/apache/ \
--enable-so \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--enable-static-support
安装php
yum -y install php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd jpegsrc libmcrypt libpng libpng-devel libjpeg libxml2 libxml2-devel zlib curl curl-devel
./configure \
--prefix=/usr/local/php7/ \
--with-apxs2=/usr/local/apache/bin/apxs \
--enable-mbstring \
--with-curl \
--with-gd \
--enable-fpm \
--enable-mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-config-file-path=/usr/local/php/etc/ \
--with-mysqli=mysqlnd
cp php.ini-development /usr/local/php/etc/php.ini
报错:
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
解决步骤:
1、根据不能run apxs 。cd 到apache的bin目录下运行./apxs 运行结果
----------------------------------------------------
bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
---------------------------------------------------------
2、vim apxs文件 找“/replace/with/path/to/perl/interpreter”关键字
在第一个行 :#!/replace/with/path/to/perl/interpreter -w
根据perl的安装目录 /usr/bin/perl
修改为:#! /usr/bin/perl -w
3、运行第一步。或者直接 ./configure ^^^^^
安装memecach
第一步:安装libevent
# tar zvxf libevent-2.1.8-stable.tar.gz
# cd libevent-2.1.8-stable
# ./configure --prefix=/usr/local/libevent
# make
# make install
# cd /usr/lib64
# ln -s /usr/local/libevent/lib/libevent-2.1.so.6
第二步:安装memecached
# tar zxvf memcached-1.4.35.tar.gz
# cd memcached-1.4.35
# ./configure --prefix=/usr/local/memcached
# make
# make install
第三步:启动
# cd /usr/local/memcached/bin
# ./memcached -d -u root
第四部:测试
1.查看进程
# ps -ef|grep memcached |grep -v grep
2.查看端口
# lsof -i:11211
3.telnet测试
# telnet 192.168.6.128 11211
输入:stats
返回:
至此memecached安装成功。
配置PHP的memecached扩展
php的memcached扩展是基于libmemcached,所以要先安装libmemcached
安装libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
./configure --prefix=/usr/lib/libmemcached
make && make install
安装php-memcached-php7
./configure --enable-memcached --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/lib/libmemcached/ --disable-memcached-sasl
make && make install
重启apache
相关文章推荐
- Linux CentOS 安装 Apache PHP MYSQL Memcached Memcache 环境配置 并且辅助安装遇见的错误处理(全文搜索
- 64位CENTOS4.3安装全攻略(包括Apache,PHP,MySQL,Memcache,ZendOptimizer)
- CENTOS+ORACLE+APACHE+GD+PHP+MYSQL+WSF+Memcache完整安装
- mac 配置apache+php跟memcache的安装
- CentOS7安装Apache与PHP与新的防火墙配置
- 阿里云|Centos7及以上|LAMP(LINUX+APACHE+MYSQL+PHP) 安装教程
- Centos7 用yum命令安装LAMP环境(php+Apache+Mysql)以及php扩展
- 虚拟机下安装Centos7并配置Apache+PHP+Mysql+phpmyadmin+wordpress
- centos7 使用yum安装Apache、mariadb、PHP
- CentOS7下安装apache+php5+mariaDB
- php和apache安装memcache的过程
- 多服务器session共享之memcache共享安装和实现篇(apache+php-windows)
- CentOS7 安装配置过程 (Apache + SQL+ PHP + SSH + Opensips+Openfire)
- centOS7安装MYSQL+PHP+Apache环境
- CentOS7配置AMP安装配置(Apache + MySQL + PHP)
- windows server2008下apache+php+mysql+memcache安装与配置
- centos7 使用yum安装Apache、mariadb、PHP
- php 在centos7 apache中的安装配置
- CentOS 安装 Apache PHP MYSQL Memcached Memcache 环境配置
- Windows7 x64 安装 Wamp2.1-x64 + memcache-x64 (php-5.3.4+apache)