centos6.5编译安装php-7.2.5.tar.gz教程

2022-10-11 20:30:46 199 0
魁首哥

1: 准备安装必备工具

yum -y install make gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf\

centos6.5编译安装php-7.2.5.tar.gz教程

kernel-devel libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel\

gd gd-devel freetype freetype-devel libxml* libxml2-devel zlib zlib-devel \

glib2 glib2-devel bzip2 bzip2-devel libevent* libevent-devel ncurses ncurses-devel \

curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel \

openssl openssl-devel gettext gettext-devel ncurses-devel gmp-devel pspell-devel\

unzip libcap lsof

2:php.net上下载php-7.2.5.tar.gz

cd /data/soft

tar -zxvf php-7.2.5.tar.gz

3: cd php-7.2.5

./configure –prefix=/usr/local/php7 –with-zlib –enable-xml –with-curl –enable-fpm –with-gd –with-openssl –enable-zip –enable-soap

make

make install

4: mv /usr/local/php7/etc/ php-fpm .conf.default /usr/local/php7/etc/php-fpm.conf

cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf

cp /data/soft/php-7.2.5/php.ini-production /usr/local/php7/etc/php.ini

cp /data/soft/php-7.2.5/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm #复制php-fpm启动脚本到init.d

chmod +x /etc/init.d/php-fpm #赋予执行权限

5:配置 nginx ,nginx我前边已经装了

location ~ \.php$ {

root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;

include fastcgi_params;

}

6,启动nginx和php-fpm(fastcgi的进程管理程序)

/usr/local/nginx/sbin/nginx #启动nginx

/etc/init.d/php-fpm start #启动php-fpm

7:写的phpinfo.php文件,能访问的话就安装好了

收藏
分享
海报
0 条评论
199
上一篇:「PHP编程」var_dump(1…9)输出什么?旧方法新知识 下一篇:好看!简易版的留言板功能实例程序

本站已关闭游客评论,请登录或者注册后再评论吧~

忘记密码?

图形验证码