源码编译安装php7.2.5

1.首先下载php7.2.5.tar.gz,然后传到线上

2.tar -xzvf   php7.2.5.tar.gz 解压压缩包


3.  ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-config-file-path=/usr/local/php/etc --disable-ipv6 --with-libxml-dir  --with-openssl  --with-zlib --with-curl --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-gettext --disable-json   --enable-mbstring --with-mysql --with-mysqli  --enable-embedded-mysqli  --with-pdo-mysql --with-pcre-dir  --enable-mysqlnd   需要的一些可以自己安装

然后缺什么,yum 什么

4、编译和安装

make && make install

5.更改shell

vi ~/.bash_profile

alias php = /usr/local/php/bin/php  保存并推出

source  ~/.bash_profile

5. php -v  查看PHP版本

php  test.php  执行PHP文件





猜你喜欢

转载自blog.csdn.net/weixin_36521716/article/details/80317749