【发布时间】:2013-07-11 23:07:13
【问题描述】:
所以我的 PHP 项目导致 localhost 以及 localhost/project/ 正在为项目下载 index.php 而不是加载它,它将它下载为 download...这里是 download 文件:
<?php
/*
* Index.php - Define the directories
*
*
* DS, DIRECTORY_SEPARATOR = /
* ROOT, dirname = string containing the path of a file or directory
* __FILE__ = The full path and filename of the file. If used inside an include, the name of the included file is returned
*
* In this file we load the apporpriate files that our website wants to load and render the
* template with informatio from the database. We load the bootstrap.php from the library folder.
*
* We are not including the ?\> to avoid injection of any extra whitespaces in our output.
*
*
*/
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(dirname(__FILE__)));
$url = $_GET['url'];
require_once (ROOT . DS . 'library' . DS . 'bootstrap.php');
加载localhost 会下载这个:
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/xampp/');
exit;
?>
Something is wrong with the XAMPP installation :-(
【问题讨论】:
-
您可能没有为 apache 加载 PHP 模块?
-
你知道如何在 ubuntu 上手动加载这个吗?我会搜索尝试一下
-
你真的在 Ubuntu 上使用 XAMPP 吗?我的意思是,来自 apachefriends 的东西? - 他们甚至无法让自己的网站正确(或者#META TITLE# 应该是实际的页面标题?)。只需“sudo apt-get install apache2 php5 libapache2-mod-php5 mysql”就可以了……
-
嘿@germainelol,你真的找到解决方案了吗?我想我遇到了完全相同的问题....
-
我不认为这是 php 处理程序的问题。检查您的 index.php 文件是否具有执行权限。尝试“chmod 644 index.php”。为 index.php 授予 644 权限。它会解决:)