1: 准备安装必备工具
yum -y install make gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf\
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文件,能访问的话就安装好了
相关文章
本站已关闭游客评论,请登录或者注册后再评论吧~