yum install -y wget gcc gcc-c++ make curl curl-devel libxml2 libxml2-devel \
libjpeg libjpeg-devel libpng libpng-devel libmcrypt libmcrypt-devel zlib \
zlib-devel openssl openssl-devel freetype freetype-devel gd gd-devel perl \
perl-devel ncurses ncurses-devel bison bison-devel libtool gettext \
gettext-devel cmake pcre pcre-devel
wget -O nginx-1.13.7.tar.gz http://nginx.org/download/nginx-1.13.7.tar.gz
wget -O php-5.6.32.tar.gz http://am1.php.net/distributions/php-5.6.32.tar.gz
wget -O mysql-5.6.38.tar.gz https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.38.tar.gz
tar zxvf nginx-1.13.7.tar.gz
tar zxvf php-5.6.32.tar.gz
tar zxvf mysql-5.6.38.tar.gz
cd nginx-1.13.7
./configure --prefix=/usr/local/nginx
make && make install
# vim ~/.bash_profile
NGINX_HOME=/usr/local/nginx
PATH=$PATH:$NGINX_HOME/sbin
export PATH
cd mysql-5.6.38
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DSYSCONFDIR=/usr/local/mysql \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
make && make install
# vim ~/.bash_profile
MYSQL_HOME=/usr/local/mysql
PATH=$PATH:$MYSQL_HOME/bin
export PATH
useradd -s /sbin/nologin mysql
chown -R mysql:mysql /usr/local/mysql
cd /usr/local/mysql/scripts
./mysql_install_db \
--basedir=/usr/local/mysql \
--datadir=/usr/local/mysql/data \
--user=mysql
chkconfig:2345 80 90
chkconfig –add mysqld
- 用户初始化
```shell
/etc/init.d/mysqld start
mysql_secure_installation # 设置数据库root用户和密码
cd php-5.6.32
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php \
--enable-opcache --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data \
--with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
--with-curl --enable-mbstring=all --with-iconv --with-mhash --with-mcrypt \
--with-gd --with-openssl --enable-sockets --with-gettext --with-zlib \
--enable-zip --enable-soap --with-libxml-dir --with-png-dir \
--with-jpeg-dir --with-freetype-dir --enable-ftp --with-xmlrpc
make && make install
# vim ~/.bash_profile
PHP_HOME=/usr/local/php
PATH=$PATH:$PHP_HOME/bin:$PHP_HOME/sbin
export PATH
cp php-5.6.32/php.ini-production /usr/local/php/php.ini
# vim phpinfo.php
<?php
phpinfo();
?>
php phpinfo.php
phpize是用来扩展php扩展模块的,即不用重新编译PHP,通过phpize就可以建立php的外挂模块
cd php-5.6.32/ext
curl
]
```shell
cd curlphpize ./configure –with-php-config=/usr/local/php/bin/php-config
make && make install
3. 安装扩展
```shell
#vim /usr/local/php/php.ini
# 写入下面的配置信息
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/curl.so