-
下载包
wget http://php.net/get/php-7.1.7.tar.gz/from/this/mirror mv mirror php-7.1.7.tar.gz tar -zxvf php-7.1.7.tar.gz cd php-7.1.7.tar.gz
-
创建用户和用户组
groupadd php useradd php -g php
-
扩展库安装
yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel #安装libmcrypt wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz tar -zxvf libmcrypt-2.5.7.tar.gz && cd libmcrypt-2.5.7 ./configure --prefix=/usr/local/related/libmcrypt make & make install #安装mhash wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.bz2 tar -jxvf mhash-0.9.9.9.tar.gz & cd mhash-0.9.9.9 ./configure --prefix=/usr/local/related/mhash make & make install #安装mcrypt-2.6.8 wget https://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download mv download mcrypt-2.6.8.tar.gz tar -zxvf mcrypt-2.6.8.tar.gz cd mcrypt-2.6.8 export LD_LIBRARY_PATH=/usr/local/related/libmcrypt/lib:/usr/local/related/mhash/lib export LDFLAGS="-L/usr/local/related/mhash/lib -I/usr/local/related/mhash/include/" export CFLAGS="-I/usr/local/related/mhash/include/" ./configure --prefix=/usr/local/related/mcrypt --with-libmcrypt-prefix=/usr/local/related/libmcrypt make && make install
-
编译参数的配置
./buildconf --force #1. 生成配置文件 ./configure \ --prefix=/usr/local/php7 \ --exec-prefix=/usr/local/php7 \ --bindir=/usr/local/php7/bin \ --sbindir=/usr/local/php7/sbin \ --includedir=/usr/local/php7/include \ --libdir=/usr/local/php7/lib/php \ --mandir=/usr/local/php7/php/man \ --with-config-file-path=/usr/local/php7/etc \ --with-mysql-sock=/var/run/mysql/mysql.sock \ --with-mcrypt=/usr/include \ --with-mhash \ --with-openssl \ --with-mysql=shared,mysqlnd \ --with-mysqli=shared,mysqlnd \ --with-pdo-mysql=shared,mysqlnd \ --with-gd \ --with-iconv \ --with-zlib \ --enable-zip \ --enable-inline-optimization \ --disable-debug \ --disable-rpath \ --enable-shared \ --enable-xml \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-mbregex \ --enable-mbstring \ --enable-ftp \ --enable-gd-native-ttf \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-soap \ --without-pear \ --with-gettext \ --enable-session \ --with-curl \ --with-jpeg-dir \ --with-freetype-dir \ --enable-opcache \ --enable-fpm \ --enable-fastcgi \ --with-fpm-user=nginx \ --with-fpm-group=nginx \ --without-gdbm \ --with-mcrypt=/usr/local/related/libmcrypt \ --disable-fileinfo make & make install cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf mv ~/php-fpm.conf /usr/local/php7/etc/php-fpm.conf && mv ~/www.conf /usr/local/php7/etc/php-fpm.d/www.conf #启动php-fpm php-fpm
-
配置nginx+php-fpm+laravel
-
修改php-fpm的用户
vim /usr/local/php7/etc/php-fpm.d/www.confuser=nginx group=nginx
-
修改nginx.conf
vim /usr/local/nginx/conf/nginx.confuser nginx nginx; worker_processes 1; pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; keepalive_timeout 65; gzip on; server { listen 80; server_name localhost; root /home/nginx/project/lavue/public; index index.html index.htm index.php; location ~ .*\.(php|php5)?$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } location /{ index index.php; } } }
-
CentOS编译安装PHP7
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 一、配置防火墙,开启80端口、3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为i...
- 目标:centos6.8上编译php7.1.10 问题拆解: 1.准备编译的centos6.8系统(百度云地址) ...