dongtan4046 2013-12-12 00:11
浏览 80

瘦全PHP请求全局致命错误

I'm experiencing a problem with all the requests in my app. The below error is returned in about 20% of requests, no matter a specific request, it seems to be indiscriminate in frequency based on the request. This problem started appearing when I decided to run the app locally on my new computer, so I'm guessing it's an environment issue. Given the infrequency of it and my unfamiliarity with the Slim core I feel at a loss to address this issue.

I'm running PHP-FPM - running PHP 5.3.27 - on top of Nginx. I'm running Slim 2.4.0 Let me know if you need to know any php.ini values, the modules in the PHP install, or anything else relevant. Since it's an issue global to the app I'm not sure exactly what code to include. Thanks a lot for your help.

Notice: Undefined property: Slim\Slim::$container in Slim/Slim.php on line 234

Notice: Indirect modification of overloaded property Slim\Slim::$container has no effect in Slim/Slim.php on line 239

Notice: Undefined property: Slim\Slim::$container in Slim/Slim.php on line 234

Notice: Indirect modification of overloaded property Slim\Slim::$container has no effect in Slim/Slim.php on line 155

Notice: Undefined property: Slim\Slim::$container in Slim/Slim.php on line 234

Fatal error: Call to a member function singleton() on a non-object in Slim/Slim.php on line 158

Below is the top of my index.php (where all non-file requests get routed) showing the instantiation of the \Slim\Slim object. There's nothing but constant definitions in config.php and all the responses are defined in lines following these:

/**
* Define Constants
 */
require_once 'config.php';

/**
 * Require the Slim Framework
 *
 * If you are not using Composer, you need to require the
 * Slim Framework and register its PSR-0 autoloader.
 *
 * If you are using Composer, you can skip this step.
 */
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();

/**
 * Instantiate a Slim application
 *
 * This example instantiates a Slim application using
 * its default settings. However, you will usually configure
 * your Slim application now by passing an associative array
 * of setting names and values into the application constructor.
 */
$app = new \Slim\Slim(array(
    'mode' => 'development',
    'debug' => false,
    'log.enabled' => false,
    'templates.path' => APPPATH . '/templates',
    'cookies.encrypt' => true,
    'cookies.lifetime' => '12 hour',
    'cookies.secret_key' => '$apr1$4s961sza$txDJLrSg2suGYqkWf24wL.'
));

$res = $app->response();
$res['Content-Type'] = 'application/json';
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?