码迷,mamicode.com
首页 > Web开发 > 详细

php安装

时间:2018-03-01 00:36:21      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:php5 php7安装

安装php5

cd /usr/local/src/
wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
tar zxf php-5.6.30.tar.gz
cd php-5.6.30
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

提示
configure: error: xml2-config not found. Please check your libxml2 installation.

技术分享图片

解决方法: yum install -y libxml2-devel

提示:
技术分享图片
解决方法:yum install -y openssl-devel

提示:
configure: error: Please reinstall the BZip2 distribution
解决方法:yum install -y bzip2-devel

提示:configure: error: jpeglib.h not found.
解决方法:yum install -y libjpeg-devel

提示:configure: error: png.h not found.
解决方法:yum install -y libpng-devel

提示:configure: error: freetype-config not found.
解决方法:yum install -y freetype-devel

提示:configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决方法:
yum install -y epel-release
yum install -y libmcrypt-devel
问题解决

make
make install

拷贝配置文件到目录下
cp php.ini-production /usr/local/php/etc/php.ini

配置php7
cd /usr/local/src/
wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2
tar zxf php-7.1.6.tar.bz2
cd php-7.1.6
./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php7/etc --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif
make && make install
ls /usr/local/apache2.4/modules/libphp7.so
du -sh !$
查看apache加载的php
cp php.ini-production /usr/local/php7/etc/php.ini

php安装

标签:php5 php7安装

原文地址:http://blog.51cto.com/13528516/2074117

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!