安装wordpress Ubuntu问题

我已经安装了wordpress但是当我把这个链接http:// localhost / wordpress /我看到脚本文件时:

<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp-blog-header.php' ); 

PHP代码显示为原始文本。 这是因为没有安装Apache的PHP模块。

运行以下命令:

 sudo apt update sudo apt install php7.0 sudo apt install libapache2-mod-php7.0 sudo a2enmod php7.0 sudo systemctl restart apache2.service 

这应该让你的灯工作正常。

请注意, php7.0是Ubuntu 16.04的默认版本。 您需要为将来的版本安装最新版本的php。

用apache检查已安装的PHP!? 您可以使用以下内容创建phpinfo.php:

?>复制我们的htdocs文件夹并在浏览器中打开! —- stooni

    Interesting Posts