我已经安装了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' );发布于 2018-01-04 14:48:11
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是Ubuntu16.04的默认版本。您需要为以后的版本安装php的最新版本。
发布于 2016-01-17 11:25:51
用apache检查已安装的PHP!?您可以创建一个具有以下内容的phpinfo.php:
?>在htdocs文件夹中复制并在浏览器中打开!
https://askubuntu.com/questions/663887
复制相似问题