手工搭建LAMP环境(CentOS 7.8 PHP7.0) 输入上一步骤中获取的安装MySQL时自动设置的root用户密码 The existing password for the user account root has expired. Please set a new password. New password: 设置新的root用户密码 Reenter new password: 再次输入密码 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 php70wdevel php70w.x8664 php70wcli.x8664 php70wcommon.x8664 php70wgd.x8664 php70wldap.x8664 php70wmbstring.x8664 php70wmcrypt.x8664 php70wpdo.x8664 php70wmysqlnd php70wfpm php70wopcache php70wpeclredis php70wpeclmongodb b.执行以下命令,验证PHP的安装版本。 php v 回显如下类似信息: PHP 7.0.33 (cli) (built: Dec 6 2018 22:30:44) ( 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 4、浏览器访问测试。 a.在/var/www/html/目录下创建“info.php”的测试页面。 1.执行以下命令创建并打开“info.php”的测试文件。 vim /var/www/html/info.php 2.按i键进入编辑模式。 3.修改打开的“info.php”文件,将如下内容写入文件。 4.按Esc键退出编辑模式,并输入:wq保存后退出。 b.执行以下命令,重启Apache服务。 systemctl restart httpd c.使用浏览器访问“