php7 源码安装

42次阅读

共计 1215 个字符,预计需要花费 4 分钟才能阅读完成。

安装 php 依赖组件
yum -y install wget openssl* gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers make gd gd2 gd-devel gd2-devel libaio
下载
官网下载地址:http://php.net/downloads.php
解压并安装
#解压
tar -zxvf php-7.2.12.tar.gz
cd php-7.2.12

# 安装
./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –with-iconv-dir –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –with-curlwrappers –enable-mbregex –enable-fpm –enable-mbstring –with-mcrypt –enable-ftp –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap –with-gettext –with-mysql=mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd
make && make install
扩展命令
#查看 php.ini 目录
php -i |grep php.ini

# 设置 php 为全局变量
vim /etc/profile
export PATH=$PATH:/usr/local/php/bin #添加到配置文件
source /etc/profile #配置文件修改,需要立即生效执行此命令

正文完
 0