下载7:
$ cd $ mkdir php7test $ cd php7test $ wget http://cn2.php.net/get/php-7.0.7.tar.gz/from/this/mirror $ tar -zxvf php-7.0.7.tar.gz $ cd php-7.0.7
装置一些依赖:
$ yum -y install libjpeg libpng freetype libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel curl-devel libxslt-devel lib2 lib2-devel
设置装备摆设configure
$ ./configure --prefix=/data/php7 --with-config-file-path=/data/php7/etc --with-config-file-scan-dir=/data/php7/etc/php.d --with-mcrypt=/usr/include --enable-mysqlnd --with-mysqli --with-pdo-mysql --enable-fpm --with-fpm-user=xxxxxxxxxx --with-fpm-group=xxxxxxxxxx --with-gd --with-iconv --enable-xml --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --with-zlib --enable-bcmath --enable-sockets
而后:
$ make $ make install
默许装置好之后,你会发现/data/php7/etc上面不php.ini文件,这个去那里要呢?正在php7的源码装置包都有。
进入源码装置包的目次
$ cd $ cd php7test/php-7.0.7 $ ls
能够看到有两个php.ini-xxx的文件
$ cp php.ini* /data/php7/etc/ $ cp php.ini-production /data/php7/etc/php.ini
启用php-fpm
先设置装备摆设config文件
$ cd /data/php7/etc $ cp php-fpm.conf.default php-fpm.conf $ cp php-fpm.d/www.conf.default php-fpm.d/www.conf
正在编译以前./configure的时分,咱们都曾经确定了一些设置装备摆设,比方运转fpm的用户以及用户组之类的,以是默许设置装备摆设应该没有会存正在门路成绩以及权限成绩。
搞定php-fpm的效劳载入
咱们心愿应用service php-fpm start|stop|restart这些操作来完成效劳的重启,但不像nginx那末复杂,php编译好之后,给咱们提供了一个php-fpm的顺序,没有需求我再编写分享了。这个文件放正在php编译源码目次中:
$ cd $ cd php7test/php-7.0.7/sapi/fpm $ cp init.d.php-fpm /etc/init.d/php-fpm $ chmod +x /etc/init.d/php-fpm $ chkconfig --add php-fpm $ chkconfig php-fpm on
经过下面这个操作,咱们就能够应用sevice php-fpm start来启用php-fpm了。用ps -ef | grep php-fpm看看过程吧。
或许经过应用/data/php7/sbin/php-fpm来启动php7.
Finish & Success
保举教程:《PHP7》
以上就是PHP7正在开发机上的装置应用之旅的具体内容,更多请存眷资源魔其它相干文章!
标签: PHP7 php7开发教程 php7开发资料 php7开发自学
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。
抱歉,评论功能暂时关闭!