4LeafClove 2014-08-07 14:27 采纳率: 0%
浏览 10661

打开php项目网站,页面显示为空白

环境:apache,php用的是苹果自带的
项目是放在默认DocumentRoot: "/Library/WebServer/Documents"下面

新建的VirtualHost 的DocumentRoot: "/Library/WebServer/Documents/myProject/public"
在public目录下有index.phtml文件

cat public/index.php


<?php
/**

  • This makes our life easier when dealing with paths. Everything is relative
  • to the application root now. */

chdir(dirname(__DIR__));

// Decline static file requests back to the PHP built-in webserver

if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
return false;
}

// Setup autoloading
require 'init_autoloader.php';

// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();

打开网页后,显示空白,错误信息是
[Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error)

然后我在index.php里面添加了一句phpinfo(),然后页面显示了phpinfo的页面

以上我的情况和问题就是这样,请教各位大神帮我看看问题是出在哪里了!多谢!!
补充:查看了/var/log/apache2/erro_log
显示错误为AsseticWriter : Unable to create a directory

  • 写回答

1条回答 默认 最新

  • franzhong 2014-08-10 08:20
    关注

    一堆的东西看的人头晕,我跟据你这句话判断路径是正确的,问题为PHP页面问题

    "在index.php里面添加了一句phpinfo(),然后页面显示了phpinfo的页面 "

    Failed to load resource: the server responded with a status of 500
    报了个500错误,却是服务端异常并非语法错误,我也郁闷了
    你用zend了?查一下ZendServer\etc\ZendEnablerConf.xml是否有乱码
    可能的结果是??xml version="1.0" encoding="UTF-8"?>
    开头的一句应该是<?xml version="1.0" encoding="UTF-8"?>
    祝你好运

    评论

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型