douzhuang1900 2013-07-18 21:33
浏览 39

在lighttpd下没有得到zend的错误

I actually solved this problem eventually, but it took so long that I thought I would post the question I was going to post a few hours ago so others that might happen to run into it would not find themselves in the same boat of wasting 5 hours trying to solve a simple problem.

I was trying to get a version of Zend running under an installation of lighttpd with a scaled down php and Zend core framework running through fastcgi but the problem was that any time I confronted an error, it was not reporting in the browser and was not showing up in any of the log files. (the actual platform was android which added to the confusion, but the problem turned out to be a lighttpd/zend configuration issue non-specific to the platform)

Since I wasn't sure at which layer the logging was failing, I tried everything from modifying the error/logging settings in the lighttpd.conf, fastcgi values in both the lighttpd and php configuration files and setting various logging parameters in php.ini but none of them produced any error messages in the logs even though the zend page in question was saying 'Application Error' and little else.

  • 写回答

1条回答 默认 最新

  • dongmeiyi2266 2013-07-18 21:33
    关注

    What I ended up discovering was that all of the examples I had run across of setting up the lighttpd.conf showed good examples on how to set up the fastcgi, how to set the server parameters, how to configure php, etc. and even how to translate typical apache .htaccess files used for Zend including rewrite rules into something similar in the lighttpd.conf

    What none of them did make obvious was the setting of any required Zend environment variables.

    Under a default zend site configuration such as you might find on the Zend help pages, they generally set up some kind of bootstrap.php along with a corresponding application.ini file. In the examples I saw most often and therefore the ones I followed, they included the ability to configure multiple application environments such as production, testing, development, etc. This was controlled on the server in question by setting the environment variable APPLICATION_ENV to include the environment.

    In my particular set up, the 'production' environment in the example I used was the default and turned 'off' all php, exception and other error logging for the production environment to avoid users seeing ugly errors in a production setting. Since this ran after Zend started, it over-rides anything previously configured in lighttp.conf or php.ini. Even though this has been common in most of the exmaples I've seen on configuring a zend server, none of the examples I saw for lighttpd showed setting this variable and since I was focused on the 'layers' involved, it slipped my mind.

    So setting the environment in the lighttpd.conf to include development environment made my errors visible again:

    setenv.add-environment("APPLICATION_ENV"=>'development')
    

    Now I have a functional zend LAMP server implementation running on my cell phone using bitweb for android! Thanks Andi!

    评论

报告相同问题?

悬赏问题

  • ¥15 使用ESP8266连接阿里云出现问题
  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角