在 CentOS7最小化 下的编译安装:Nginx 1.5.2 + PHP 5.5.7 + MySQL 5.6.10
1、安装Nginx:
安装包目录
mkdir -p /Data/tgz
cd /Data/tgz
安装编译依赖
yum install wget
yum install pcre
yum install openssl*
yum -y install gcc gcc-c++ autoconf 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 openldap openldap-devel nss_ldap openldap-clients openldap-servers make
yum -y install gd gd2 gd-devel gd2-devel
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
ulimit -SHn 65535
perl语言兼容正则表达式,是一个用C语言编写的正则表达式函数
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.32.tar.gz
tar zxvf pcre-8.32.tar.gz
cd pcre-8.32
./configure --prefix=/Data/apps/pcre
make && make install
cd ../
wget http://nginx.org/download/nginx-1.5.2.tar.gz
tar zxvf nginx-1.5..tar.gz
cd nginx-1.5.
./configure --user=www --group=www --prefix=/Data/apps/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/Data/tgz/pcre-8.32 --with-http_realip_module --with-http_image_filter_module
make
make install
cd ../
./configure
--user=www 设置nginx运行时以什么用户来运行worker进程(默认为nobody用户)
--group=www 设置nginx运行时以什么组来运行worker进程(默认为nobody组)
--prefix=/Data/apps/nginx 指明nginx的安装所在路径
--with-http_stub_status_module 启用 “server status” 页
--with-http_ssl_module 开启HTTP SSL模块,使NGINX可以支持HTTPS请求。这个模块需要已经安装了OPENSSL,在DEBIAN上是libssl
--with-pcre=/Data/tgz/pcre-8.32 指定 PCRE 库的源代码的路径
--with-http_realip_module 启用 ngx_http_realip_module
--with-http_image_filter_module nginx提供的集成图片处理模块 HttpImageFilterModule模块需要依赖gd-devel的支持,可以使用yum或apt-get方便地安装,如果未安装回报“/configure: error: the HTTP image filter module requires the GD library.”错误
nginx编译安装参数
2、安装 MySQL:
wget http://downloads.mysql.com/archives/mysql-5.6/mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
tar zxvf mysql-5.6.-linux-glibc2.-x86_64.tar.gz
mv mysql-5.6.-linux-glibc2.-x86_64 /Data/apps/mysql
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
mkdir -p /Data/data/mysql/data
yum install libaio
/Data/apps/mysql/scripts/mysql_install_db --basedir=/Data/apps/mysql --datadir=/Data/data/mysql/data --user=mysql sed -i "s#/usr/local/mysql#/Data/apps/mysql#g" /Data/apps/mysql/bin/mysqld_safe
3、安装php依赖库
php处理图形的扩展库,安装GD库前得先安装freetype、libpng、jpegsrc、zlib等关联库
mkdir -p /Data/apps/libs/
wget http://www.ijg.org/files/jpegsrc.v9.tar.gz
tar zxvf jpegsrc.v9.tar.gz
cd jpeg-/
./configure --prefix=/Data/apps/libs --enable-shared --enable-static --prefix=/Data/apps/libs
make
make install
cd ../
wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.2.tar.gz
tar zxvf libpng-1.6..tar.gz
cd libpng-1.6./
./configure --prefix=/Data/apps/libs
make
make install
cd ../
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
tar zxvf freetype-2.4..tar.gz
cd freetype-2.4./
./configure --prefix=/Data/apps/libs
make
make install
********************************** 报错 start ********************************* 当 make install 时总是: rm -f /usr/local/modules/freetype/include/freetype2/freetype/cache/* rmdir /usr/local/modules/freetype/include/freetype2/freetype/cache rm -f /usr/local/modules/freetype/include/freetype2/freetype/internal/* rmdir /usr/local/modules/freetype/include/freetype2/freetype/internal rmdir: ‘/usr/local/modules/freetype/include/freetype2/freetype/internal’: 没有那个文件或目录 make: [install] 错误 1 (忽略) /usr/bin/install -c -m 644 ./builds/unix/ft2unix.h \ /usr/local/modules/freetype/include/ft2build.h /usr/bin/install -c -m 644 ./builds/unix/ftconfig.h \ /usr/local/modules/freetype/include/freetype2/freetype/config/ftconfig.h /usr/bin/install -c -m 644 /opt/src/lamp/freetype-2.2.1/objs/ftmodule.h \ /usr/local/modules/freetype/include/freetype2/freetype/config/ftmodule.h /usr/bin/install -c -m 755 ./builds/unix/freetype-config \ /usr/local/modules/freetype/bin/freetype-config /usr/bin/install -c -m 644 ./builds/unix/freetype2.m4 \ /usr/local/modules/freetype/share/aclocal/freetype2.m4 /usr/bin/install -c -m 644 ./builds/unix/freetype2.pc \ /usr/local/modules/freetype/lib/pkgconfig/freetype2.pc (报错) 解决办法: mkdir /Data/apps/libs/include/freetype2/freetype/internal 需要在freetype的安装目录下创建internal 这个目录然后, make install ********************************** 报错 end *********************************
cd ../
php加密扩展库
wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?big_mirror=0"
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure --prefix=/Data/apps/libs
make
make install
cd libltdl/
./configure --prefix=/Data/apps/libs --enable-ltdl-install
make
make install
cd ../../
mhash的可以用于创建校验数值,消息摘要,消息认证码,以及无需原文的关键信息保存(如密码)等。
wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?big_mirror=0"
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure --prefix=/Data/apps/libs
make
make install
cd ../ vi /etc/ld.so.conf 添加:
/Data/apps/libs/lib 然后:
ldconfig
Mcrypt扩展库可以实现加密解密功能,就是既能将明文加密,也可以密文还原。
wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?big_mirror=0"
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
export LDFLAGS="-L/Data/apps/libs/lib -L/usr/lib"
export CFLAGS="-I/Data/apps/libs/include -I/usr/include"
touch malloc.h
./configure --prefix=/Data/apps/libs --with-libmcrypt-prefix=/Data/apps/libs
make
make install
cd ../
4、编译安装PHP 5.5
wget http://www.php.net/get/php-5.5.1.tar.gz/from/tw2.php.net/mirror tar zxvf php-5.5.1.tar.gz cd php-5.5.1/ export LIBS="-lm -ltermcap -lresolv" export DYLD_LIBRARY_PATH="/Data/apps/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64" export LD_LIBRARY_PATH="/Data/apps/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64" ./configure --prefix=/Data/apps/php --with-config-file-path=/Data/apps/php/etc --with-mysql=/Data/apps/mysql --with-mysqli=/Data/apps/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir=/Data/apps/libs --with-jpeg-dir=/Data/apps/libs --with-png-dir=/Data/apps/libs --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt=/Data/apps/libs --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-zts make make install cp php.ini-development /Data/apps/php/etc/php.ini cd ../
ln -s /Data/apps/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib mv /Data/apps/php/etc/php-fpm.conf.default /Data/apps/php/etc/php-fpm.conf
./configure
--prefix=/Data/apps/php 是指PHP的安装目录
--with-config-file-path=/Data/apps/php/etc php.ini文件位置
--with-mysql=/Data/apps/mysql 包含MySQL支持
--with-mysqli=/Data/apps/mysql/bin/mysql_config 包含MySQLi支持。参数为mysql_config的位置。
--with-iconv-dir
--with-freetype-dir=/Data/apps/libs
--with-jpeg-dir=/Data/apps/libs 打开对jpeg图片的支持
--with-png-dir=/Data/apps/libs 打开对png图片的支持
--with-zlib ##–-with-zlib-dir 打开zlib库的支持
--with-libxml-dir=/usr 打开libxml2库的支持
--enable-xml
--disable-rpath 禁用在搜索路径中传递其他运行库。
--enable-bcmath 打开图片大小调整,用到zabbix监控的时候用到了这个模块
--enable-shmop
--enable-sysvsem
--enable-inline-optimization
--with-curl 打开curl浏览工具的支持
--enable-mbregex
--enable-fpm 打上php-fpm 补丁后才有这个参数,cgi方式安装的启动程序
--enable-mbstring 多字节,字符串的支持
--with-mcrypt=/Data/apps/libs 加密算法
--with-gd 打开gd库的支持
--enable-gd-native-ttf 支持TrueType字符串函数库
--with-openssl openssl的支持,加密传输时用到的
--with-mhash 加密算法
--enable-pcntl freeTDS需要用到的,可能是链接mssql 才用到
--enable-sockets 打开 sockets 支持
--with-xmlrpc 打开xml-rpc的c语言
--enable-zip 打开对zip的支持
--enable-soap
--enable-opcache
--with-pdo-mysql
--enable-maintainer-zts
php编译安装时的参数
5、编译安装PHP扩展
wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz tar zxvf autoconf-latest.tar.gz cd autoconf-2.69/ ./configure --prefix=/Data/apps/libs make make install cd ../
wget http://pecl.php.net/get/memcache-2.2.7.tgz tar zxvf memcache-2.2.7.tgz cd memcache-2.2.7/ export PHP_AUTOCONF="/Data/apps/libs/bin/autoconf" export PHP_AUTOHEADER="/Data/apps/libs/bin/autoheader" /Data/apps/php/bin/phpize ./configure --with-php-config=/Data/apps/php/bin/php-config make make install cd ../
打开 /Data/apps/php/etc/php.ini 查找 ; extension_dir = "ext"
在其后增加一行:
extension = "memcache.so"
原链接:http://zyan.cc/nginx_php_v7/
在 CentOS7最小化 下的编译安装:Nginx 1.5.2 + PHP 5.5.7 + MySQL 5.6.10的更多相关文章
- LNMP一键安装包-CentOS 5/6下自动编译安装Nginx,MySQL,PHP
适用环境: 系统支持:CentOS-5 (32bit/64bit).CentOS-6 (32bit/64bit) 内存要求:≥128M 安装了什么: 1.Nginx-1.2.0 2.MySQL 5.5 ...
- centos7 最小化安装 无 ifconfig,netstat 的安装
centos7 最小化安装 无 ifconfig,netstat 的安装 centos7 最小化安装之后,默认是没有 ifconfig,netstat命令的: 我们可以直接使用 yum -y inst ...
- Centos7最小化安装之工作站设置
Centos7最小化安装之工作站设置 实测在Vultr的VPS上正常可用 在Vultr上怎么看桌面 两种解决方法: 使用VNC远程连接 直接使用Vultr的view console功能 我使用的是第二 ...
- CentOS7最小化安装-Linux-1
CentOS 7的安装其实很简单,主要是网络配置. 选英文.设置时区等 最小化安装 先启动一个网络 Begin 吧 在安装的时候设置好root密码.很简单 别去点安装tools. 等待安装完成后,点击 ...
- CentOS7.3环境下源码安装httpd
CentOS7.3环境下源码安装httpd 本文在CentOS7.3下,源码安装apache服务httpd2.4. 1.下载好源码安装包 [root@localhost ~]#ll total 625 ...
- Centos7 编译安装 Nginx、MariaDB、PHP
前言 本文主要大致介绍CentOS 7下编译安装Nginx.MariaDB.PHP.面向有Linux基础且爱好钻研的朋友.技艺不精,疏漏再所难免,还望指正. 环境简介: 系统: CentOS 7,最小 ...
- Centos7 编译安装 Nginx PHP Mariadb Memcached 扩展 ZendOpcache扩展 (实测 笔记 Centos 7.3 + Mariadb 10.1.20 + Nginx 1.10.2 + PHP 7.1.0 + Laravel 5.3 )
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...
- Centos7 编译安装 Nginx Mariadb Asp.net Core2 (实测 笔记 Centos 7.3 + Openssl 1.1.0h + Mariadb 10.3.7 + Nginx 1.14.0 + Asp.net. Core 2 )
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...
- Centos7 编译安装 Nginx PHP Mariadb Memcached 扩展 ZendOpcache扩展 (实测 笔记 Centos 7.3 + Openssl 1.1.0e + Mariadb 10.1.22 + Nginx 1.12.0 + PHP 7.1.4 + Laravel 5.4 )
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...
随机推荐
- vue-router 动态路由匹配
export default new Router({ routes: [ { path: '/', name: 'HelloWorld', component: HelloWorld, }, { / ...
- JavaScript 获取文件名,后缀名
function getBaseName(str) { var segs = str.split('.'); if(segs.length > 1) segs.pop(); return seg ...
- C语言可以给字符数组赋值的方法
分类: C 2012-04-06 10:23 4081人阅读 评论(0) 收藏 举报 语言c 学了这么多年的C语言,突然发现连字符串赋值都出错,真的很伤心. char a[10]; 怎么给这个数组赋值 ...
- JAVA学习第四十八课 — IO流(二):文件的复制 & 缓冲区1
一.复制文本文件 将G盘的文本文件拷贝到D盘上 也就是 读取G盘中文本文件的数据.写入D盘中->连读带写 而剪切呢.就是连读带写后,删除原盘的文件 <span style="fo ...
- WebService学习小结
基于web的服务,服务器整理资源供多个客户端应用访问,是一种多个跨平台跨语言的应用间通信整合的方案 使用场景:天气预报.股票.地图,火车票 schema约束复习 <!-- book.xsd,定义 ...
- jm解决乱码问题-参数化-数据库操作-文件上传下载
jm解决乱码问题-参数化-数据库操作-文件上传下载 如果JM出果运行结果是乱码(解决中文BODY乱码的问题) 找到JM的安装路径,例如:C:\apache-jmeter-3.1\bin 用UE打开jm ...
- oracle数据库权限管理
权限管理: oracle 9里面默认的三个username和password: sys change_on_install //权限最高的管理员 system manager //普通的管理员 sco ...
- $.ajax 温故而知新坑
$.ajax的配置项中使用 contentType: "application/json" 时,Data选项允许为String类型,如JSON.stringify({abc:123 ...
- js中有特殊字符的编码格式
在get和post方法中,如果传入的参数值有特殊字符,如:“&”,在get中的url需要拼接,可以使用encodeURICompontent来编码来转化 回调就是在上面传递实际参数,传递给aj ...
- 关于myeclipse中启动项目(server为welogic10)报valid license.bea错误的问题解决方式
之前由于重转系统.导致我的weblogic和myeclipse都要重装.重装之后,出现了问题,我是依照weblogic破解版的步骤来的.但还是报例如以下错误: Unable to start WebL ...