linux PHP7.0安装实战步骤详细展示

发布时间:2024年01月02日

PHP7.0安装步骤

[root@ser3 Desktop]# wget  http://cn2.php.net/distributions/php-7.0.4.tar.gz


[root@ser3 Desktop]# rpm -qa libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 curl-devel libxslt-devel openssl-devel    
[root@ser3 Desktop]# yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxslt-devel openssl-devel    
[root@ser3 Desktop]# tar xf php-7.0.4.tar.gz    
[root@ser3 Desktop]# cd php-7.0.4    
[root@ser3 php-7.0.4]# ./configure --prefix=/usr/local/php7 --exec-prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc  --with-curl  --with-freetype-dir  --with-gd  --with-gettext  --with-iconv-dir  --with-kerberos  --with-libdir=lib64  --with-libxml-dir  --with-mysqli  --with-openssl  --with-pcre-regex  --with-pdo-mysql  --with-pdo-sqlite  --with-pear  --with-png-dir  --with-xmlrpc  --with-xsl  --with-zlib --with-zlib-dir --with-mhash --with-mcrypt --with-openssl-dir --with-jpeg-dir --enable-gd-jis-conv  --enable-fpm  --enable-bcmath  --enable-libxml  --enable-inline-optimization  --enable-gd-native-ttf  --enable-mbregex  --enable-mbstring  --enable-opcache  --enable-pcntl  --enable-shmop  --enable-soap  --enable-sockets  --enable-sysvsem  --enable-xml  --enable-zip
[root@ser3 php-7.0.4]# make    
[root@ser3 php-7.0.4]# make  test    
[root@ser3 php-7.0.4]# make install

[root@ser3 php-7.0.4]# cp php.ini-production /usr/local/php7/etc/php.ini


[root@ser3 php-7.0.4]# cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
[root@ser3 php-7.0.4]# cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf    
[root@ser3 php-7.0.4]# cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm


[root@ser3 php-7.0.4]# chmod +x /etc/init.d/php-fpm    
[root@ser3 php-7.0.4]# chkconfig --add php-fpm


[root@ser3 php-7.0.4]# /etc/init.d/php-fpm start
[root@ser3 php-7.0.4]# ps -ef | grep php-fpm
错误1:configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/

在这里插入图片描述

[root@wtj-web-01 php-7.0.4]# yum -y install curl-devel

执行成功如下
在这里插入图片描述

错误2:configure: error: mcrypt.h not found. Please reinstall libmcrypt.

在这里插入图片描述

[root@wtj-web-01 php-7.0.4]# wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
[root@wtj-web-01 php-7.0.4]# tar -zxvf libmcrypt-2.5.7.tar.gz
[root@wtj-web-01 php-7.0.4]# cd libmcrypt-2.5.7
[root@wtj-web-01 php-7.0.4]# ./configure --prefix=/usr/local/libmcrypt
[root@wtj-web-01 php-7.0.4]#make && make install
文章来源:https://blog.csdn.net/good6666zl/article/details/129090679
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。