如此簡單
第一步:
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm yum install php php-fpm php-mysql nginx mariadb-server -y yum install php-gd* -y
第二步:
vi /etc/php-fpm.d/www.conf
修改
第三步:
systemctl start php-fpm
systemctl start nginx
如需開通文件上傳功能請修改php.ini
vi /etc/php.ini
upload_max_filesize = 100M
簡單配置 數據庫
systemctl start mariadb
mysql_secure_installation Enter current password for root (enter for none): #初次運行直接回車 Set root password? [Y/n] #是否設置root用戶密碼,輸入y並回車或直接回車 New password: #設置root用戶的密碼 Re-enter new password: # 再輸入一次你設置的密碼 Remove anonymous users? [Y/n] # 是否刪除匿名用戶,回車 Disallow root login remotely? [Y/n] #是否禁止root遠程登錄,回車, Remove test database and access to it? [Y/n] # 是否刪除test數據庫,回車 Reload privilege tables now? [Y/n] # 是否重新加載權限表,回車
root 用戶支持遠程訪問
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
flush privileges;