yum install gcc automake autoconf libtool gcc-c++
# 安装基础库
yum install gd zlib zlib-devel openssl openssl-devel libxml2 libxml2-devel
yum install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel
# 下载pcre 正则库
cd /usr/local/src
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.bz2
tar jxf pcre-8.38.tar.bz2
mv pcre-8.38.tar.bz2 ./pcre
#安装nginx
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar zxf nginx-1.8.0.tar.gz
cd nginx-1.8.0
./configure --prefix=/usr/local/src/nginx --with-pcre=/usr/local/src/pcre
make && make install
#安装php
wget http://cn2.php.net/get/php-5.6.29.tar.gz/from/this/mirror
mv mirror php-5.6.29.tar.gz
tar zxf php-5.6.29.tar.gz
cd php-5.6.29
./configure --prefix=/usr/local/src/php \
--prefix=/usr/local/phpmake && make installcd /usr/local/src/phpcp etc/php-fpm.conf.default etc/php-fpm.confcp /usr/local/src/php-5.6.29/php.ini-development ./lib/php.ini./sbin/php-fpm#整合php与nginxvim /usr/local/src/nginx/conf/nginx.conf#编辑这几行代码 跟我的一样就行了location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/src/nginx/html$fastcgi_script_name; include fastcgi_params; }./sbin/nginx -s reloadvim /usr/local/src/php/lib/php.ini把这行的分号去掉加上PRCdate.timezone = PRCpkill -9 php/usr/local/src/php/sbin/php-fpm#.MySQL5.7 的编译安装的方法其实和yum安装差不多的简单并且两者没有什么区别(我用的目录是在 /usr/local/)1.一切从必要依赖开始。yum install -y gcc gcc-c++ ncurses-devel perl2.下载 mysql 与 cmakewget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.10.tar.gzwget https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz3.解压tar -xzvf cmake-3.4.1.tar.gzcd cmake-3.4.1 ./bootstrapmake && make install4.安装完 cmake,就开始着手 MySQL 编译安装的步骤。首先为添加 MySQL 对应的系统账户,用于保证其本地文件权限分配groupadd mysqluseradd -r -g mysql mysql5.创建数据库目录:mkdir -p /var/mysql/datachown mysql:mysql /var/mysql/data6.解压mysqltar zxf mysql-boost-5.7.10.tar.gz cd mysql-5.7.10cmake \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DMYSQL_DATADIR=/var/mysql/data \ -DMYSQL_TCP_PORT=3306 \ -DWITH_BOOST=boost参数说明:-DCMAKE_INSTALL_PREFIX=/usr/local/mysql //安装目录-DMYSQL_DATADIR=/usr/local/mysql/data //数据库存放目录-DWITH_MYISAM_STORAGE_ENGINE=1 //安装 myisam 存储引擎-DWITH_INNOBASE_STORAGE_ENGINE=1 //安装 innodb 存储引擎-DWITH_ARCHIVE_STORAGE_ENGINE=1 //安装 archive存储引擎-DWITH_BLACKHOLE_STORAGE_ENGINE=1 //安装 blackhole存储引擎-DENABLED_LOCAL_INFILE=1 //允许从本地导入数据-DDEFAULT_CHARSET=utf8 //使用 utf8 字符-DDEFAULT_COLLATION=utf8_general_ci //校验字符-DEXTRA_CHARSETS=all //安装所有扩展字符集-DMYSQL_TCP_PORT=3306 //MySQL 监听端口-DMYSQL_USER=mysql //MySQL 用户名其他参数:-DWITH-EMBEDDED_SERVER=1 //编译成 embedded MySQL library (libmysqld.a)-DSYSCONFDIR=/etc //MySQL 配辑文件-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock //Unix socket 文件路径-DWITH_READLINE=1 //快捷键功能-DWITH_SSL=yes //SSL-DWITH_MEMORY_STORAGE_ENGINE=1 //安装 memory 存储引擎-DWITH_FEDERATED_STORAGE_ENGINE=1 //安装 frderated 存储引擎-DWITH_PARTITION_STORAGE_ENGINE=1 //安装数据库分区-DINSTALL_PLUGINDIR=/usr/local/mysql/plugin //插件文件及配置路径7.执行完 cmake 的配置过程,就需要开始准备最为 漫长的 的编译过程,根据不同机器的配置,时间大约在半个 小时左右(低配情况下 4 小时以上也是可能的)。执行编译和安装操作已经很熟悉了make && make installchown -R mysql:mysql /usr/local/mysql8.如果提示已存在文件是否覆盖时,覆盖即可。cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf9.这时候会初始化数据库并创建一个数据库root账号,但是要注意,和以前不一样的是,这个账号是有默认密码的,初始化的时候屏幕上会输出初始化的密码,如果错过了,可以通过百度/usr/local/mysql/bin/mysqld --initialize --user=mysql10.将 mysql 的服务启动脚本复制过去cp /usr/local/mysql/support-files/mysql.server /etc/init.d11.启动 mysqlservice mysql.server start 12.进入数据密码是上面图片的中所说的密码/usr/local/mysql/bin/mysql -u root -p13.设置你的密码set password=password('你的密码');14.如图请看你的默认密码 安装完成
--disable-debug
--disable-phpdbg
--enable-mysqlnd
--enable-bcmath
--with-bz2=/usr
--enable-calendar
--with-curl
--enable-exif
--enable-fpm
--with-freetype-dir
--enable-ftp
--with-gd
--enable-gd-jis-conv
--enable-gd-native-ttf
--with-gettext=/usr
--with-gmp
--with-iconv
--enable-intl
--with-jpeg-dir
--enable-mbstring
--with-mcrypt
--with-openssl
--enable-pcntl
--with-pdo-mysql=mysqlnd
--with-png-dir
--with-recode=/usr
--enable-shmop
--enable-soap
--enable-sockets
--enable-sysvmsg
--enable-sysvsem
--enable-sysvshm
--enable-wddx
--with-xmlrpc
--with-xsl
--with-zlib=/usr
--enable-zip
--with-mysqli=mysqlnd