码迷,mamicode.com
首页 > Web开发 > 详细

CentOS 7.4 php、ngnix环境搭建

时间:2018-12-17 21:33:31      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:创建   star   ssi   目录   phpize   art   eve   cal   str   

cd /usr/local/src

tar -xvzf php-5.6.39.tar.gz
cd php-5.6.39

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --enable-mbstring --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-zlib --with-openssl
make
make install
 
复制配置文件及执行文件
ln -s/usr/local/php/bin/php /usr/bin/php
cp/usr/local/src/php-5.6.39/php.ini-production /usr/local/php/etc/php.ini
ln -s/usr/local/php/etc/php.ini /etc/php.ini
cp/usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp/usr/local/src/php-5.6.39/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
增加可执行权限
chmod +x/etc/init.d/php-fpm
修改配置文件php.ini
vi /etc/php.ini
date.timezone = PRC
session.save_path="/var/lib/php/session" 
记得要手动创建下这个目录
mkdir -p/var/lib/php/session
 
service php-fpm start
 
cd /usr/local/nginx/html/
unzip v.zip
yum install unzip
service php-fpm restart
 
cd /usr/local/src/
yum install -y gcc gcc-c++  pcre pcre-devel  zlib zlib-devel openssl openssl-devel
tar -xvzf nginx-1.14.2.tar.gz
cd nginx-1.14.2
 ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --pid-path=/usr/local/nginx/conf/nginx.pid --with-pcre
make && make install
cd /usr/local/nginx/conf/
cp nginx.conf nginx.conf.default
vi nginx.conf
../sbin/nginx -t
../sbin/nginx -s start
../sbin/nginx
sbin/nginx -s reload
 
cd /usr/local/src/php-5.6.39
 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --enable-mbstring --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-zlib --with-openssl --with-png-dir --with-gd
yum -y install gd gd2 gd-devel gd2-devel zlib freetype
 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --enable-mbstring --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-zlib --with-openssl --with-png-dir --with-gd
make && make install
 
cd /usr/local/nginx/html/
vi conf/nginx.conf
 
cd /usr/local/src/
yum install gcc libxml2-devel openssl-devel curl-devel -y
yum install php-gd
service php-fpm restart
cd php-5.6.39
vi /etc/php.ini
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --enable-mbstring --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-zlib --with-openssl --with-gd
cd /usr/local/src/php-5.6.39/ext/gd
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --enable-mbstring --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-zlib --with-openssl --with-png-dir --with-gd
/usr/local/php/bin/phpize
service php-fpm stop
cd /usr/local/nginx/html
service php-fpm start
cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
yum -y install gd gd2 gd-devel gd2-devel 
cd /usr/local/src/
tar -xvzf jpegsrc.v9b.tar.gz
./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
cd jpeg-9b/
./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
make && make install
cd /usr/local/src/php-5.6.39/ext/gd/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config -with-png-dir --with-freetype-dir --with-jpeg-dir=/usr/local/jpeg -with-zlib-dir --with-gd
cd /usr/local/src/php-5.6.39/ext/gd/
phpize
/usr/local/php/bin/phpize
yum install m4
yum install autoconf
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config -with-png-dir --with-freetype-dir --with-jpeg-dir=/usr/local/jpeg -with-zlib-dir --with-gd
cd   /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
cd /usr/local/src/php-5.6.39/ext/gd
make && make install
 cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
service php-fpm restart

CentOS 7.4 php、ngnix环境搭建

标签:创建   star   ssi   目录   phpize   art   eve   cal   str   

原文地址:https://www.cnblogs.com/rachael/p/10133971.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!