扣丁学堂教你手动搭建php服务器

2018-08-14 15:14:58 336浏览

今天小编来给参加PHP培训的同学带来干货——怎样手动搭建php服务器。

 

 

一、安装nginx

1、官网下载nginx安装包

wgethttp://nginx.org/download/nginx-1.4.7.tar.gz

2、tar-zxvfnginx-1.4.7.tar.gz

3、./configure

4、make&&makeinstall

5、将nginx写入centos服务中vi/etc/init.d/nginx

6、查看虚拟机服务器的防火墙是否关闭

7、nginxstartnginxreloadnginxstop

二、安装php

1、官网下载php安装包

wgethttp://cn2.php.net/distributions/php-5.6.35.tar.gz

2、tarzvxfphp-5.6.35.tar.gz

3、手动编译php依赖扩展

./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-config-file-scan-dir=/usr/local/php/conf.d--enable-fpm--with-fpm-user=www--with-fpm-group=www--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl--enable-mbregex--enable-mbstring--with-mcrypt--enable-ftp--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--with-gettext--disable-fileinfo--enable-opcache--enable-intl--with-xsl

4、make&&makeinstall

5、配置php-fpm

cd/usr/local/php

cp/etc/php-fpm.conf.default/etc/php-fpm.confvi/etc/php-fpm.conf

6、将php-fpm写入centos服务中vi/etc/init.d/php-fpm

7、启动php-fpm进程

servicephp-fpmstartservicephp-fpmrestartservicephp-fpmstop

以上为服务器需要的php和nginx,mysql部分单独安装即可

注意:

编译php扩展的时候先phpize后在configure--with-php-config=......否则从官网下载的扩展压缩包里面没有configure文件。


以上就是扣丁学堂PHP培训小编给大家分享的文章,希望对小伙伴们有所帮助,想要了解更多关于PHP开发方面内容的小伙伴可以登录扣丁学堂官网咨询。扣丁学堂不仅有专业的PHP培训班供大家学习,还有与时俱进的课程体系和大量的PHP在线视频教程让学员免费观看学习,想要快速学习PHP开发就到由专业老师授课的扣丁学堂学习吧。扣丁学堂PHP技术交流群:374332265。

【关注微信公众号获取更多学习资料】

 

 

查看更多关于“php培训资讯”的相关文章>>

标签: PHP培训 PHP视频教程 PHP开发工程师

热门专区

暂无热门资讯

课程推荐

微信
微博
15311698296

全国免费咨询热线

邮箱:codingke@1000phone.com

官方群:148715490

北京千锋互联科技有限公司版权所有   北京市海淀区宝盛北里西区28号中关村智诚科创大厦4层
京ICP备12003911号-6   Copyright © 2013 - 2019

京公网安备 11010802030908号