LNMP安装配置
PHP yum安装:yum install -y php-fpm php-mysql php-gd#phpfpm 连接nginx#php-mysql 连接数据库的#php-gd 图形库程序安装后启动PHP,会查看到9000端口systemctl start php-fpm#测试,在网站更目录里创建文件vim index.php<?phpphpinfo();?>#添加nginx配置文件,*.conf文件vim */php.conflocation / {root /usr/share/nginx/html/;index index.html index.htm;}location ~* \.php$ {index index.php;fastcgi_pass 127.0.0.1:9000; #退给谁include fastcgi_params; #导入此文件fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param SCRIPT_NAME $fastcgi_script_name;root /usr/share/nginx/html/;index index.php;}
MySQL配置
yum -y install mariadb mariadb-serversystemctl start mariadb.servicesystemctl enable mariadb.servicemysqladmin password '123456'mysql -uroot -p123456MariaDB [(none)]> create database bbs;MariaDB [(none)]> grant all on bbs.* to phptest@'*' identified by '123456';MariaDB [(none)]> flush privileges;
