参考https://www.jianshu.com/p/02baa54283ba
配置完成重启nginx
#systemctl restart nginx.service
如果出现:Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.错误
运行:
ps -ef | grep nginx
pkill -9 nginx
index.php内容:
<html>
<head>
<title>PHP 测试</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
<?php phpinfo(); ?>
</body>
</html>
把index.php复制到:/usr/share/nginx/html
最后访问localhost/index.php