php7.2编译安装

1.安装依赖包

yum -y install php-mcrypt libmcrypt libmcrypt-devel  autoconf  freetype freetype-devel gd libmcrypt libpng libpng-devel openjpeg openjpeg-devel  libjpeg libjpeg-devel  libxml2 libxml2-devel zlib curl curl-devel 

2. 编译安装

tar xf php-7.2.3.tar.gz
cd php-7.2.3/

./configure --prefix=/usr/local/php7  \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-config-file-path=/usr/local/php7/etc/  \
 --enable-mbstring  \
--with-curl  \
--enable-fpm  \
--enable-mysqlnd  \
--enable-bcmath   \
--enable-sockets   \
--enable-ctype   \
--with-jpeg-dir   \
--with-png-dir   \
--with-freetype-dir  \
--with-gettext   \
--with-gd  \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd

make && make install

3. 生成配置文件

cp php.ini-development  /usr/local/php7/etc/php.ini

4. 修改apache配置,使apache支持php

vim /usr/local/apache2/

#配置支持解析php,配置文件末尾添加即可
Addtype application/x-httpd-php .php .phtml

#添加index.php首页文件,修改现有配置
DirectoryIndex index.html index.php
Tags:php
上一篇
下一篇

添加新评论