yum安裝的版本只有5.1,因此手動安裝php
tar -xzvf php-5.6.16.tar.gz
libxml2
: yum install libxml2-develbzip2
: yum install bzip2 bzip2-develcurl
: yum -y install curl-devellibpng
:yum install libpng libpng-devellibmcrypt
:yum install libmcrypt libmcrypt-develreadline
: yum -y install readline readline-devel./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear --with-gd
複製代碼
cp /opt/lib/php-5.6.28/sapi/fpm/php-fpm.conf /usr/local/php/etc/php-fpm.conf
複製代碼
cp /usr/local/php/sbin/php-fpm /usr/local/bin/php-fpm
複製代碼
12.啓動php-fpm
css
13.新建index.phphtml
<?php
phpinfo();
複製代碼
14.成功mysql
yum 安裝 yum -y install nginx
nginx
刪除 /etc/nginx/conf.d下全部文件git
配置本身的服務 vim mysite.conf
sql
server {
charset utf-8; client_max_body_size 128M; listen 80; server_name www.wexue.top; root /opt/server/gmfitness-wx; index index.php index.html; access_log /opt/log/access.log; error_log /opt/log/error.log; location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php$is_args$args; } #轉發 location /wxnotify { proxy_pass http://XXXXX/index.php?g=Restful&m=Vip&a=wxnotify;
}
# uncomment to avoid processing of calls to non-existing static files by Yii
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
# try_files $uri =404;
#}
#error_page 404 /404.html;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
location ~ /\.(ht|svn|git) {
deny all;
}
}
複製代碼
啓動:yum自動安裝了nginx的服務,service nginx start
shell
yum -y install mysql-server mysql mysql-devel
service mysqld start
複製代碼
chkconfig mysqld on
chkconfig --list | grep mysql
複製代碼
mysqladmin -u root password '密碼'
複製代碼
mysql -uroot -p
use mysql
;select user,host from user
;mysql> update user set host='%' where user='root';
mysql> flush privileges;
複製代碼
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密碼' WITH GRANT OPTION;
mysql> flush privileges;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'tuser'@'192.168.1.100' IDENTIFIED BY '密碼' WITH GRANT OPTION;
mysql> flush privileges;
複製代碼