systemctl restart network
systemctl stop firewalld
setenforce 0
yum -y install ncurses-devel perl perl-devel perl-DBD*
tar -zxvf cmake-2.8.6.tar.gz -C /usr/src/
tar -zxvf mysql-5.6.36.tar.gz -C /usr/src/
tar -zxvf nginx-1.12.0.tar.gz -C /usr/src/
tar -zxvf libmcrypt-2.5.8.tar.gz -C /usr/src/
tar -zxvf mhash-0.9.9.9.tar.gz -C /usr/src
tar -zxvf mcrypt-2.6.8.tar.gz -C /usr/src/
tar -zxvf php-5.5.38.tar.gz -C /usr/src/
tar -zxvf zend-loader-php5.5-linux-x86_64_update1.tar.gz -C /usr/src/
cd /usr/src/cmake-2.8.6/
./configure && gmake && gmake install
cd /usr/src/mysql-5.6.36/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all
make && make install
useradd -M -s /sbin/nologin mysql
chown -R mysql:mysql /usr/local/mysql/
rm -f /etc/my.cnf
cp /usr/src/mysql-5.6.36/support-files/my-default.cnf /etc/my.cnf
cp /usr/src/mysql-5.6.36/support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod +x /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
echo "PATH=$PATH:/usr/local/mysql/bin">> /etc/profile
. /etc/profile
/usr/local/mysql/scripts/mysql_install_db --user=mysql --group=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
systemctl restart mysqld
yum -y install pcre-devel zlib-devel
useradd -M -s /sbin/nologin nginx
cd /usr/src/nginx-1.12.0/
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
make && make install
ln -s /usr/local/nginx/sbin/* /usr/local/sbin/
rpm -qa | grep php
rpm -e php php-cli php-ldap php-common php-mysql –nodeps
yum -y install xz-devel libxml2-devel libjpeg-devel zlib-devel libpng-devel
cd /usr/src/libmcrypt-2.5.8/
./configure && make && make install
ln -s /usr/local/lib/libmcrypt.* /usr/lib
cd /usr/src/mhash-0.9.9.9/
./configure && make && make install
ln -s /usr/local/lib/libmhash* /usr/lib/
cd /usr/src/mcrypt-2.6.8/
export LD_LIBRARY_PATH=/usr/local/lib: LD_LIBRARY_PATH
./configure && make && make install
cd /usr/src/php-5.5.38/
./configure --prefix=/usr/local/php --with-mcrypt --with-gd --with-zlib --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/usr/local/php --enable-mbstring --enable-fpm --enable-sockets --with-jpeg-dir=/usr/lib
make && make install
ln -s /usr/local/php/bin/* /usr/local/bin/
ln -s /usr/local/php/sbin/* /usr/local/sbin/
cp /usr/src/php-5.5.38/php.ini-development /usr/local/php/php.ini
sed -i 's/;default_charset = "UTF-8"/default_charset = "UTF-8"/g' /usr/local/php/php.ini
sed -i "s/short_open_tag = Off/short_open_tag = On/g" /usr/local/php/php.ini
cp /usr/src/zend-loader-php5.5-linux-x86_64/ZendGuardLoader.so /usr/local/php/
echo "zend_extension=/usr/local/php/ZendGuardLoader.so" >>/usr/local/php/php.ini
echo "zend_loader.enable=1" >>/usr/local/php/php.ini
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
useradd -M -s /sbin/nologin php
sed -i "25a pid = run/php-fpm.pid " php-fpm.conf
sed -i "149a user = php " php-fpm.conf
sed -i "250a group = php " php-fpm.conf
sed -i "230a pm.max_children = 50 " php-fpm.conf
sed -i "235a pm.start_servers = 20 " php-fpm.conf
sed -i "240a pm.min_spare_servers = 5 " php-fpm.conf
sed -i "245a pm.max_spare_servers = 35 " php-fpm.conf
killall -9 php-fpm
php-fpm
echo "tianzi" > /usr/local/nginx/html/index.html
killall -9 nginx
nginx
firefox http://192.168.1.1
成功!!!!!!!!!!!!!!!!!!!!
后面 是改php的访问文件内容 【 注意:$ 的引用 加个 index 下面加一个index.php访问目录 可以创建一个访问目录
mkdir /var/www/baidu
echo "<?php" > /var/www/baidu/index.php
echo "\$link=mysqli_connect('localhost','root','123.com');" >> /var/www/baidu/index.php
echo 'if($link) echo "恭喜你,数据库连接成功啦!!";' >> /var/www/baidu/index.php
echo "?>" >> /var/www/baidu/index.php
sed -i "s/#location ~ \.php$ { /location ~ \.php$ {/g" /usr/local/nginx/conf/nginx.conf
sed -i "65d" /usr/local/nginx/conf/nginx.conf
sed -i "66d" /usr/local/nginx/conf/nginx.conf
sed -i "67d" /usr/local/nginx/conf/nginx.conf
sed -i "68d" /usr/local/nginx/conf/nginx.conf
sed -i "69d" /usr/local/nginx/conf/nginx.conf
sed -i "70d" /usr/local/nginx/conf/nginx.conf
sed -i "71d" /usr/local/nginx/conf/nginx.conf
sed -i "65a location ~ \.php$ { " /usr/local/nginx/conf/nginx.conf
sed -i "66a fastcgi_pass 127.0.0.1:9000; " /usr/local/nginx/conf/nginx.conf
sed -i "67a fastcgi_index index.php; " /usr/local/nginx/conf/nginx.conf
sed -i "68a fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name " /usr/local/nginx/conf/nginx.conf
sed -i "69a include fastcgi.conf; " /usr/local/nginx/conf/nginx.conf
sed -i "70a } " /usr/local/nginx/conf/nginx.conf
以上内容 mysql没有授权!!