centos6.8安装PHP 7.0.10

前端之家收集整理的这篇文章主要介绍了centos6.8安装PHP 7.0.10前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

sudo tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14/
./configure --prefix=/usr/local
make

make install

1、安装libmcrypt

cd /usr/local/src #进入软件包存放目录
tar zxvf libmcrypt-2.5.8.tar.gz #解压

cd libmcrypt-2.5.8 #进入安装目录

./configure #配置

make #编译

make install #安装

2、安装mhash

cd /usr/local/src

tar zxvf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure

make

make install

3、安装mcrypt

cd /usr/local/src

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

ln -s /usr/local/bin/libmcrypt_config /usr/bin/libmcrypt_config #添加软连接

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH #添加环境变量

./configure

make

make install

sudo tar zxvf PHP-7.0.10.tar.gz

cd PHP-7.0.10

./configure --prefix=/myweb/PHP --with-config-file-path=/myweb/PHP/etc --with-MysqL=MysqLnd --with-MysqL-sock=/myweb/MysqL/MysqL.sock --with-MysqLi=MysqLnd --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-ftp --with-pear --enable-exif --with-mcrypt --with-pdo-MysqL=MysqLnd --with-apxs2=/myweb/apache/bin/apxs --with-mcrypt

在安装一个软件包时,最后输入sudo make install命令后,出现以下错误信息:
error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
但是在/usr/local/lib下却能找到libiconv.so.2,解决方法是将/usr/local/lib路径添加到/etc/ld.so.conf文件中,然后用sudo ldconfig命令加载,再重新输入sudo make install命令就可以了。
include ld.so.conf.d/*.conf
/usr/local/lib

sudo make ZEND_EXTRA_LIBS='-liconv'

19、sudo make install安装
20、复制PHP.ini进/myweb/PHP/etc/下
cp PHP.ini-production /myweb/PHP/etc/PHP.ini
设置/myweb/apache/conf/httpd.conf 找到libPHP7.so的设置位置 修改
LoadModule PHP7_module modules/libPHP7.so。
AddType application/x-httpd-PHP .PHP
AddType application/x-httpd-PHP-source .PHPs
21、设置documentroot设置为/myweb/webroot
23、重启apache sudo apachectl restart
sudo ln -s /myweb/PHP/bin/PHPize /usr/bin/PHPize
sudo ln -s /myweb/apache/bin/apachectl /usr/bin/apachectl

sudo tar zxvf apcu-5.1.3.tgz
cd apcu-5.1.3
sudo PHPize
sudo ./configure --with-PHP-config=/myweb/PHP/bin/PHP-config
sudo make
sudo make install
sudo ln -s /myweb/PHP/lib/PHP/extensions/no-debug-zts-20151012/* /myweb/PHP/ext/
extension_dir = "/myweb/PHP/lib/PHP/extensions/no-debug-zts-20151012/"

sudo PHPize ./configure --with-PHP-config=/myweb/PHP/bin/PHP-config make && make install 修改PHP.ini extension_dir = "./myweb/PHP/lib/PHP/extensions/no-debug-zts-20121212/" date.timezone = PRC [zendopcache] zend_extension=opcache.so [apcu] extension=apcu.so

猜你在找的CentOS相关文章