准备
-----------------------------------------------------------------------------------------------------------------------------------------------------------
各种包下载网址
nginx下载 http://101.96.8.164/nginx.org/download/nginx-1.11.9.tar.gz
pcre下载 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.gz
mysql下载 https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar
jpeg下载 http://www.ijg.org/files/jpegsrc.v9b.tar.gz
libpng下载 https://nchc.dl.sourceforge.net/project/libpng/libpng16/1.6.28/lpng1628.7z
freetype下载 http://101.96.8.165/download.savannah.gnu.org/releases/freetype/freetype-doc-2.7.tar.gz
libmcrypt 下载 https://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
mhash下载 https://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
libiconv 下载 http://101.96.8.165/ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
mcrypt 下载 https://nchc.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
php7 下载 http://101.96.8.164/am1.php.net/distributions/php-7.1.1.tar.gz
yaf 下载 http://pecl.php.net/get/yaf-3.0.2
http://101.96.8.164/pecl.php.net/get/yaf-3.0.4.tgz
phpredis-php7 下载 https://codeload.github.com/phpredis/phpredis/zip/php7
swoole 下载 http://101.96.8.165/pecl.php.net/get/swoole-1.9.5.tgz
redis 下载 http://download.redis.io/releases/
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
yum -y install wget openssl* 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 opendldap opendldap-devel nss_ldap openldap-clients openldap-servers make gd gd2 gd-devel gd2-devel libaio
ulimit -SHn 65535
ulimit -n
echo "ulimit -SHn 65535" >>/etc/profile
vi /etc/profile
ulimit -SHn 65535
vi /etc/security/limits.conf
* soft nproc 11000
* hard nproc 11000
* soft nofile 655350
* hard nofile 655350
vi /etc/security/limits.d/20-nproc.conf
* soft nproc unlimited
------------------------------------------------------------------------------------------------------------------------------------------------------------
安装pcre
93 cd pcre-8.38/
94 ./configure --prefix=/data/apps/pcre
95 make
96 make install
------------------------------------------------------------------------------------------------------------------------------------------------------
安装nginx
/usr/sbin/groupadd www && /usr/sbin/useradd -s /sbin/nologin -g www www
cd nginx-1.10.1/
./configure --user=www --group=www --prefix=/data/apps/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/data/tgz/pcre-8.38 --with-http_realip_module --with-http_image_filter_module
make
make install
-------------------------------------------------------------------------------------------------------------------------------------------------
tar vxf mysql-5.6.12-linux-glibc2.5-x86_64.tar
groupadd mysql && useradd -r -g mysql mysql
mv /data/tgz/mysql-5.6.12-linux-glibc2.5-x86_64 /data/apps/mysql
chown -R mysql:mysql mysql
mkdir -p /data/data/mysql/data && chown -R mysql:mysql /data/data/mysql
su mysql
/data/apps/mysql/scripts/mysql_install_db --user=mysql --basedir=/data/apps/mysql --datadir=/data/data/mysql/data
exit
cp /data/apps/mysql/support-files/my-default.cnf /etc/my.cnf && cp /data/apps/mysql/support-files/mysql.server /etc/init.d/mysql
vi /etc/init.d/mysql
basedir=/data/apps/mysql
datadir=/data/data/mysql/data
vi /etc/profile
export MYSQL_HOME="/data/apps/mysql"
export PATH="PATH:$MYSQL_HOME/bin"
source /etc/profile
chkconfig --add mysql
chkconfig mysql on
service mysql start
ps -aux |grep mysql
/data/apps/mysql/bin/mysqladmin -u root password '123'
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1234' WITH GRANT OPTION;
flush privileges;
------------------------------------------------------------------------------------------------------------------------------------------------------------
php安装 解决依赖依次进行
一:
cd /data/tgz/
tar zvxf jpegsrc.v9.tar.gz
cd jpeg-9/
./configure --prefix=/data/apps/libs --enable-shared --enable-static
make && make install
二:
192 cd /data/tgz/
193 tar zxvf libpng-1.6.2.tar.gz
194 cd libpng-1.6.2/
195 ./configure --prefix=/data/apps/libs
196 make && make install
三:
198 cd /data/tgz/
199 tar zxvf freetype-2.4.12.tar.gz
200 cd freetype-2.4.12/
201 ./configure --prefix=/data/apps/libs
202 make && make install
四:
204 cd /data/tgz/
205 tar zxvf libmcrypt-2.5.8.tar.gz
206 cd libmcrypt-2.5.8/
207 ./configure --prefix=/data/apps/libs
208 make && make install
209 cd libltdl/
210 ./configure --prefix=/data/apps/libs --enable-ltdl-install
211 make && make install
五:
213 cd /data/tgz/
214 tar zvxf mhash-0.9.9.9.tar.gz
215 cd mhash-0.9.9.9/
216 ./configure --prefix=/data/apps/libs
217 make && make install
六:
219 cd /data/tgz/
220 tar zxvf libiconv-1.14.tar.gz
221 cd libiconv-1.14/
222 ./configure --prefix=/data/apps/libs
223 make && make install
225 vi /etc/ld.so.conf
/data/apps/libs/lib
226 /sbin/ldconfig
七:
229 cd /data/tgz/
230 tar zxvf mcrypt-2.6.8.tar.gz
231 cd mcrypt-2.6.8/
232 export LDFLAGS="-L/data/apps/libs/lib -L/usr/lib"
233 export CFLAGS="-I/data/apps/libs/include -I/usr/include"
234 touch malloc.h
235 ./configure --prefix=/data/apps/libs --with-libmcrypt-prefix=/data/apps/libs
236 make && make install
---------------------------------------------------------------------------------------------------------------------------------------------------------
开始php编译安装
238 cd /data/tgz/
239 tar zxvf php-7.0.7.tar.gz
240 cd php-7.0.7/
./configure --prefix=/data/apps/php7 --with-config-file-path=/data/apps/php7/etc --with-mysqli=/data/apps/mysql/bin/mysql_config --with-iconv=/data/apps/libs --with-freetype-dir=/data/appslibs --with-jpeg-dir=/data/apps/libs --with-png-dir=/data/appslibs --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 --with-bz2 --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-zts --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --without-pear --with-gettext --enable-fpm --enable-opcache=no
make && make install
cp php.ini-development /data/apps/php7/etc/php.ini && cp ./sapi/fpm/php-fpm.conf /data/apps/php7/etc/php-fpm.conf && cp /data/apps/php7/etc/php-fpm.d/www.conf.default /data/apps/php7/etc/php-fpm.d/www.conf
cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
vi /data/apps/php7/etc/php-fpm.d/www.conf
user=www
group=www
listen 0.0.0.0:9000
/data/apps/php7/sbin/php-fpm
失败的话
cp -Rf /data/ /Data/
---------------------------------------------------------------------------------------------------------------------------------------------------------------
php扩张安装
一:
285 cd /Data/tgz/
286 tar zxvf yaf-3.0.2.tgz
287 cd yaf-3.0.2/
288 /Data/apps/php7/bin/phpize
289 ./configure --with-php-config=/Data/apps/php7/bin/php-config
290 make && make install
292 cd /Data/tgz/
293 unzip phpredis-php7.zip
294 y
295 cd phpredis-php7/
296 /Data/apps/php7/bin/phpize
297 ./configure --with-php-config=/Data/apps/php7/bin/php-config
298 make && make install
299 cd /Data/tgz/
300 tar zxvf msgpack-2.0.1.tgz
301 cd msgpack-2.0.1/
302 /Data/apps/php7/bin/phpize
303 ./configure --with-php-config=/Data/apps/php7/bin/php-config
304 make && make install
305 cd /Data/tgz/
306 tar zxvf swoole-1.8.4.tgz
307 cd swoole-1.8.4/
308 /Data/apps/php7/bin/phpize
309 ./configure --with-php-config=/Data/apps/php7/bin/php-config
310 make && make install
311 cd /Data/apps/php7/lib/php/
312 ls
313 vi /Data/apps/php7/etc/php.ini
extension_dir = "/Data/apps/php7/lib/php/extensions/no-debug-zts-20151012/"
extension ="yaf.so"
extension ="swoole.so"
extension ="redis.so"
extension ="msgpack.so"