centos6.8安装php7.0,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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值