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