linux 安装PHP/nginx 环境
2018-01-04 12:21
190 查看
STEP 1:
依次编译安装依赖包 openssl pcre zlib三个包
然后安装curl 如果要开启ssl模式的话 需要在编译时加上 --with-openssl=/usr/local/openssl
STEP2:
安装php
./configure --prefix=/usr/local/php --enable-fpm
--with-curl=/usr/local/curl
--with-pcre-dir=/usr/local/pcre
--with-zlib-dir=/usr/local/zlib
--with-openssl-dir=/usr/local/openssl
--with-mysqli --enable-mbstring
STEP3:
安装nginx
./configure --prefix=/usr/local/nginx
--with-pcre=/usr/local/src/pcre-8.39
--with-zlib=/usr/local/src/zlib-1.2.11
--with-openssl=/usr/local/src/openssl-1.1.0e
STEP4:安装一系列扩展库
安装pdo扩展 (php7 需要 yum install autoconf)
1,进入php源码目录 cd /usr/local/src/php-5.6.27/ext/pdo_mysql
2,在当前文件夹下运行phpize命令 /usr/local/php/bin/phpize 回车
3,输入命令 ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql
4,make && make install
安装openssl扩展 (php7 需要将/usr/local/src/php-5.6.27/ext/openssl下的config0.m4拷贝成config.m4)
1,进入php源码目录 cd /usr/local/src/php-5.6.27/ext/openssl
2,在当前文件夹下运行phpize命令 /usr/local/php/bin/phpize 回车
3,输入命令 ./configure --with-php-config=/usr/local/php/bin/php-config --with-openssl
4,make && make install
安装gd扩展
yum install libpng(如果没有安装这个依赖包)
yum install libpng-devel(如果没有安装这个依赖包)
1,进入php源码目录 cd /usr/local/src/php-5.6.27/ext/gd
2,在当前文件夹下运行phpize命令 /usr/local/php/bin/phpize 回车
3,输入命令 ./configure --with-php-config=/usr/local/php/bin/php-config --with-gd
4,make && make install
新建nginx用户并归到root组下:
adduser nginx
passwd nginx
修改 /etc/sudoers 文件,找到下面一行,把前面的注释(#)去掉
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
然后修改用户,使其属于root组(wheel),命令如下:
#usermod -g root tommy
修改完毕,现在可以用tommy帐号登录,然后用命令 su - ,即可获得root权限进行操作
依次编译安装依赖包 openssl pcre zlib三个包
然后安装curl 如果要开启ssl模式的话 需要在编译时加上 --with-openssl=/usr/local/openssl
STEP2:
安装php
./configure --prefix=/usr/local/php --enable-fpm
--with-curl=/usr/local/curl
--with-pcre-dir=/usr/local/pcre
--with-zlib-dir=/usr/local/zlib
--with-openssl-dir=/usr/local/openssl
--with-mysqli --enable-mbstring
STEP3:
安装nginx
./configure --prefix=/usr/local/nginx
--with-pcre=/usr/local/src/pcre-8.39
--with-zlib=/usr/local/src/zlib-1.2.11
--with-openssl=/usr/local/src/openssl-1.1.0e
STEP4:安装一系列扩展库
安装pdo扩展 (php7 需要 yum install autoconf)
1,进入php源码目录 cd /usr/local/src/php-5.6.27/ext/pdo_mysql
2,在当前文件夹下运行phpize命令 /usr/local/php/bin/phpize 回车
3,输入命令 ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql
4,make && make install
安装openssl扩展 (php7 需要将/usr/local/src/php-5.6.27/ext/openssl下的config0.m4拷贝成config.m4)
1,进入php源码目录 cd /usr/local/src/php-5.6.27/ext/openssl
2,在当前文件夹下运行phpize命令 /usr/local/php/bin/phpize 回车
3,输入命令 ./configure --with-php-config=/usr/local/php/bin/php-config --with-openssl
4,make && make install
安装gd扩展
yum install libpng(如果没有安装这个依赖包)
yum install libpng-devel(如果没有安装这个依赖包)
1,进入php源码目录 cd /usr/local/src/php-5.6.27/ext/gd
2,在当前文件夹下运行phpize命令 /usr/local/php/bin/phpize 回车
3,输入命令 ./configure --with-php-config=/usr/local/php/bin/php-config --with-gd
4,make && make install
新建nginx用户并归到root组下:
adduser nginx
passwd nginx
修改 /etc/sudoers 文件,找到下面一行,把前面的注释(#)去掉
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
然后修改用户,使其属于root组(wheel),命令如下:
#usermod -g root tommy
修改完毕,现在可以用tommy帐号登录,然后用命令 su - ,即可获得root权限进行操作
相关文章推荐
- VPS 快速安装 Linux+Nginx+MySQL+PHP 环境
- linux(ubuntu) php 调试环境安装
- UBUNTU10.10安装LAMP(Linux、Apache、Mysql、Php)环境图文教程
- Linux环境FastDFS分布式文件系统及PHP扩展库的安装与配置
- linux 下php环境的安装及Discuz论坛安装
- lnmp (linux+nginx+mysql+php) 环境安装脚本
- 64位Linux环境安装PHP TCC 扩展方法
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境
- 安装Moodle2.2步骤--在LAMP环境(linux+apache+mysql+php)
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境
- Linux下配置安装PHP环境
- linux 学习笔记 - php 环境安装与配置
- linux下eclipse+pdt(PHP集成开发环境安装)
- 环境安装系列 - Linux下 PHP环境安装
- LAMP攻略: LAMP环境搭建,Linux下Apache,MySQL,PHP安装与配置
- (转帖)Linux下面PHP开发环境源码安装-php,mysql,apache以及图形支持库GD的安装
- Linux下安装、配置PHP环境
- Linux下配置PHP运行环境 安装Oracle(粗略写了下)
- wdOS系统下源码编译安装LAMP环境(linux+apache+php+mysql)
- LAMP攻略: LAMP环境搭建,Linux下Apache,MySQL,PHP安装与配置