安装php7.0.5的方法是什么

发布时间:2020-08-27 10:34:45 作者:小新
来源:亿速云 阅读:118

这篇文章主要介绍了安装php7.0.5的方法是什么,具有一定借鉴价值,需要的朋友可以参考下。希望大家阅读完这篇文章后大有收获。下面让小编带着大家一起了解一下。

php7.0.5的安装方法:首先下载“php-7.0.5.tar.gz”;然后通过命令“yum install epel-release”更新扩展包;接着执行编译命令;最后修改配置文件即可。

安装php7.0.5的方法是什么

PHP7.0正式版也出来了,今天编译安装了一下,写下安装步骤,我是在centos6.6 环境中编译的,如下:

  1. 下载地址http://cn2.php.net/distributions/php-7.0.5.tar.gz
  2. 安装编译所需的包,如遇见部分包找不到 请先执行
yum  install epel-release  //扩展包更新包
yum  update //更新yum源

然后在执行如下命令

yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers  libmcrypt libmcrypt-devel  libXpm-devel

make & make install

  1. 执行编译命令
./configure --prefix=/usr/local/php --enable-fpm  --with-mcrypt=/usr/local/libmcrypt --with-zlib --enable-mbstring --enable-pcntl --with-openssl  --enable-soap  --with-pear   --with-png-dir    --with-pcre-regex   --enable-mysqlnd  \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/lib/mysql/mysql.sock  --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf   --with-gettext --with-curl  --enable-sockets --enable-bcmath --enable-xml --with-bz2 --enable-zip --with-freetype-dir=/usr/include/freetype2/

上述命令中需要注意的是

--with-mysqli 参数 指定的是 mysql所在的bin 文件路径如:/usr/bin/mysql_config

--with-freetype-dir 指定的路径 是 /usr/include/freetype2/  如果你是yum 安装的 freetype2 的话

其他的根据你自己实际需要增删即可

  1. 配置文件
# cp php.ini-development /usr/local/php/lib/php.ini
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf# cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
# cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm

需要注意的是php7中www.conf这个配置文件配置phpfpm的端口号等信息,如果你修改默认的9000端口号需在这里改,再改nginx的配置

启动

#  /etc/init.d/php-fpm

感谢你能够认真阅读完这篇文章,希望小编分享安装php7.0.5的方法是什么内容对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,遇到问题就找亿速云,详细的解决方法等着你来学习!

推荐阅读:
  1. CentOS 6源码编译安装PHP7.0.5的操作方法
  2. python中安装pip的方法是什么

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

centos php p7

上一篇:centos yum如何安装php7

下一篇:mysql安装5.7.21版本的方法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》