data-id="1190000005005068" data-license="cc">
59store erp环境标准化
1.why to be standard
分析归纳前几个月来发布过程当中遇到的问题,dev,qa,stage,product 4个环境配置并非都一样,导致
内网测试各环境通过但在生产环境还是会跪,未永绝后患,故联合悟饭整理一个erp的标准php环境,整理
完经过测试后,将dev,qa,stage,product环境全部统一。
立即学习“PHP免费学习笔记(深入)”;
2.PHP版本选择(7.0)
为何选择php7
php之父曰:能比前一版PHP 5快上一倍
团队使用laravel框架对高版本PHP兼容性友好
大家可以使用PHP7新特性,有助于我们跟上节奏
PHP(7.0)在CentOs下的安装
1.下载
wget -O php-7.0.5.tar.gz http://cn2.php.net/get/php-7.0.5.tar.gz/from/this/mirror
2.安装开发包和依赖库
安装development tools
<code> `yum groupinstall development tools` </code>
安装yum扩展
<code> 1.`rpm -ivh http://mirrors.sohu.com/fedora-epel/6/i386/epel-release-6-8.noarch.rpm` 2.`yum update`</code>
安装PHP支持库
<code> yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel php-mcrypt</code>
3.编译PHP7.0
编译参数
<code> './configure' '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/etc' '--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'</code>
make && make install
make && make install
4.配置PHP-FPM
增加用户&用户组
groupadd www
useradd -g www www
拷贝php-fpm.conf文件cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
拷贝php-fpm include文件cp usr/local/php/etc/php-fpm.d/ww.conf.default www.conf
拷贝php.inicp php.ini-production /usr/local/php/etc/php.ini
5.将php加入环境变量
1.vi /etc/profile
2.PATH=$PATH:/usr/local/php/bin
3.export PATH
4.source /etc/profile
6.php-fpm自启动
1.拷贝cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
加入系统启动项
chkconfig php-fpm on
7.重启php
service php-fpm restart
以上就介绍了centos下部署php7,包括了centos,php7方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号