尝试在 Ubuntu 17.10(VM)上使用 LEMP 安装 Wordpress

尝试在 Ubuntu 17.10(VM)上使用 LEMP 安装 Wordpress

我是 nginx 和 wordpress 的新手,正在尝试在 ubuntu 17.10(虚拟机上)上安装它们。我按照这个分步指南进行操作

https://websiteforstudents.com/install-wordpress-ubuntu-17-10-nginx-mariadb-php-fpm-lemp/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+siteforstudents+%28Website+For+Students%29

然后,如果我输入 localhost,我可以看到 nginx 正在工作。然后我输入 localhost/wordpress,我得到一个 502 错误网关,如果我输入 localhost/wordpress/index.php,那么它会尝试下载 php 文件(而不是执行它)。

这里出了什么问题?

谢谢,

更新:我已经按照本指南安装了 wordpress https://www.linuxbabe.com/ubuntu/install-lemp-nginx-mariadb-php7-1-ubuntu-17-10

答案1

检查您的 nginx 配置是否存在 502 错误。对于 php 文件下载,请检查您的系统上是否安装了正确的 php。使用 php --version 您应该能够检查您的 php 版本。

要在浏览器中检查 php,请在服务器上创建一个包含以下内容的 html 页面:

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

您创建的页面应显示 php 信息页面。如果您收到 502 错误 - 这是 nginx 的问题,如果正在下载 php,则说明您的服务器上的 php 执行不起作用。

相关内容