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';