php 安装教程
2024-10-08 23:03:26
php 安装教程
本文采用php7.0.1作为样例,进行安装。
系统环境:
CentOS6.7.
gcc 4.8.2
libzip 1.0.1
在安装之前,可以先更新CentOS系统。
yum -y update
下载相应依赖文件
wget "http://cn2.php.net/distributions/php-7.0.1.tar.gz" wget "http://www.nih.at/libzip/libzip-1.0.1.tar.gz"
解压相应文件
tar xvf php-7.0.1.tar.gz
tar xvf libzip-1.0.1.tar.gz
安装libzip库
cd libzip-1.0.1
./configure
make & make install
安装依赖包
此处可能会碰到so文件找不到的情况。由于为搜索/usr/lib64目录的原因,一般的解决方法就是直接软连接过去。
yum -y install gmp-devel libc-client-devel
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
ln -s /usr/lib64/libldap* /usr/lib/
编译安装PHP7.0.1
./configure --prefix=/usr/local/php701 --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-kerberos --with-openssl --with-pcre-regex --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --with-gd --with-gettext --with-gmp --enable-gd-jis-conv --enable-gd-native-ttf --with-imap --with-imap-ssl --enable-intl --with-ldap --enable-mbstring --with-libmbfl --with-mcrypt --with-mysqli --with-mysql-sock --enable-pcntl --with-pdo-mysql --enable-soap --enable-sockets --with-xmlrpc --with-xsl --enable-zip --enable-mysqlnd --enable-maintainer-zts --enable-zend-signals
make & make install
ln -s /usr/local/php701/bin/php /usr/local/bin/
ln -s /usr/local/php701/bin/phpize /usr/local/bin/
ln -s /usr/local/php701/bin/php-config /usr/local/bin/
安装redis for php 扩展
由于redis master 分支暂时不支持 php7.0.1,所以,使用phpredis支持php7的分支进行安装
wget 'https://github.com/phpredis/phpredis/archive/php7.zip'
unzip php7.zip
cd phpredis-php7
phpize
./configure
make & make install
安装memcached for php 扩展
memcached 依赖 libmemcached 和 libevent 两个包
安装libevent
wget 'https://github.com/nmathewson/Libevent/archive/release-2.0.22-stable.tar.gz'
tar xvf release-2.0.22-stable.tar.gz
cd Libevent-release-2.0.22-stable/
./configure && make && make install
安装libmemcached
wget 'https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz'
tar xvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18 ./configure make && make install
安装php-memcached
由于memcached目前版本不支持php7.1,在php-memcached讨论中找到了这个解决方法。
git clone 'https://github.com/rlerdorf/php-memcached.git'
cd php-memcached/
phpize
./configure
make && make install
至此,php 7.0.1 已安装完毕。
安装扩展如下:
'./configure' '--prefix=/usr/local/php701' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--enable-debug' '--with-kerberos' '--with-openssl' '--with-pcre-regex' '--with-zlib' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--with-curl' '--enable-exif' '--enable-ftp' '--with-gd' '--with-gettext' '--with-gmp' '--enable-gd-jis-conv' '--enable-gd-native-ttf' '--with-imap' '--with-imap-ssl' '--enable-intl' '--with-ldap' '--enable-mbstring' '--with-libmbfl' '--with-mcrypt' '--with-mysqli' '--with-mysql-sock' '--enable-pcntl' '--with-pdo-mysql' '--enable-soap' '--enable-sockets' '--with-xmlrpc' '--with-xsl' '--enable-zip' '--enable-mysqlnd' '--enable-maintainer-zts' '--enable-zend-signals'
最新文章
- PHP设计模式 迭代器模式
- jquery实现自动补全邮箱地址
- browser shell
- Sql server之路 (一)基础学习
- 弹窗插件layer
- C语言简单实现sizeof功能代码
- Javascript 多线程?
- ODI KM二次开发手册
- 快速构建Windows 8风格应用10-设备方向
- PHP5中PDO的入门教程
- Javaweb之Jsp
- GWT开端
- 安装配置rsync服务端
- [转载]Word直接发布新浪博客(以Word 2013为例)
- HDFS配额管理(实战)
- 使用Intent传递对象
- 2018-2019-2 20165315 《网络对抗技术》Exp4 恶意代码分析
- Android 7.0 fiddler代理抓不到https请求的解决办法
- redis 的 docker 镜像使用
- MySQL 中联合查询效率分析