手工搭建LNMP环境(CentOS 7.2 PHP7.0) 再次输入密码 The 'validatepassword' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press yY for Yes, any other key for No) : N 是否更改root用户密码,输入N ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press yY for Yes, any other key for No) : Y 是否删除匿名用户,输入Y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press yY for Yes, any other key for No) : Y 禁止root远程登录,输入Y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press yY for Yes, any other key for No) : Y 是否删除test库和对它的访问权限,输入Y Dropping test database... Success. Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press yY for Yes, any other key for No) : Y 是否重新加载授权表,输入Y Success. All done! 3.安装PHP。 a.依次执行以下命令,安装PHP 7和一些所需的PHP扩展。 rpm Uvh rpm Uvh yum y install php70wtidy php70wcommon php70wdevel php70wpdo php70wmysql php70wgd php70wldap php70wmbstring php70wmcrypt php70wfpm b.执行以下命令,验证PHP的安装版本。 php v 回显如下类似信息: PHP 7.0.31 (cli) (built: Jul 20 2018 08:55:22) ( NTS ) Copyright (c) 19972017 The PHP Group Zend Engine v3.0.0, Copyright (c) 19982017 Zend Technologies c.执行以下命令,启动PHP服务并设置开机自启动。 systemctl start phpfpm systemctl enable phpfpm d.修改Nginx配置文件以支持PHP。 1.执行以下命令打开配置文件/etc/nginx/nginx.conf。 vim /etc/nginx/nginx.conf 图 nginx.conf 从nginx.conf可以看出,配置文件定向至/etc/nginx/conf.d/.conf。 2.输入:quit退出nginx.conf。 3.执行以下命令打开配置文件/etc/nginx/conf.d/default.conf。 vim /etc/nginx/conf.d/default.conf 4.按i键进入编辑模式。 5.修改打开的“default.conf”文件。 找到server段落,修改或添加下列配置信息。 server { listen 80; servername localhost;