简体   繁体   English

Apache提供的空白php页面

[英]Blank php page served by apache

I recently installed apache, mysql, and php on my machine in an effort to learn some web development. 我最近在机器上安装了apache,mysql和php,以学习一些Web开发。 Until yesterday, I had no problems with configuration - everything was working fine. 直到昨天,我在配置方面都没有出现问题-一切正常。

This is my file structure 这是我的文件结构

/var/www/html/
    info.php
    phptutorial/
        index.php
        core/(more php)
        css/(more php)
        includes/(more php)

Apache is working (status: running) and when I navigate to localhost in Chrome I see the correct directory listing. Apache正在运行(状态:正在运行),当我在Chrome中导航至localhost时,会看到正确的目录列表。 However when I further navigate into the phptutorial/ directory, I am served a blank page and cannot access index.php. 但是,当我进一步导航到phptutorial /目录时,页面空白,无法访问index.php。 Yesterday the page loaded fine. 昨天页面加载正常。 I think it's a configuration problem with apache or php. 我认为这是apache或php的配置问题。 The file permissions on my directories are all 755. 我的目录上的文件权限全部为755。

Any ideas? 有任何想法吗? I also noticed that strangely there is no httpd.conf located in /etc/apache2/. 我还注意到,奇怪的是/ etc / apache2 /中没有httpd.conf。 The userdir module is enabled. userdir模块已启用。

uname -a; php -v; apache2 -v

Linux portege-R935 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
PHP 5.5.9-1ubuntu4.9 (cli) (built: Apr 17 2015 11:44:57) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
Server version: Apache/2.4.7 (Ubuntu)
Server built:   Mar 10 2015 13:05:59

Ok I realized my problem. 好的,我意识到了我的问题。 In one of my php files I was using require() to require a file which I had not yet created. 在我的一个php文件中,我正在使用require()来请求一个我尚未创建的文件。 Mittmemo was right, the problem was the php and not the server configuration. Mittmemo是正确的,问题出在php,而不是服务器配置。 Should you find yourself with a blank page then thoroughly check the php code for such mistakes. 如果发现空白页,则请彻底检查php代码是否存在此类错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM