문제

I have this simple code:

<?php

require_once __DIR__.'/../vendor/autoload.php';

$app = new Silex\Application();
$app->get('/hello', function() { return 'Hello!'; });
//$app->register(new Silex\Provider\MonologServiceProvider(), array(
//    'monolog.logfile' => __DIR__.'/development.log',
//));
$app->run();
?>

It works. If I have try to register the Monolog service (removing the 3 beginning '//' comments keywords), nothing works anymore:

$app->register(new Silex\Provider\MonologServiceProvider(), array(
    'monolog.logfile' => __DIR__.'/development.log',
));

I have try the installation through fat zip, and by composer but, same results. I am out of ideas ?

Any help would be appreciated.

도움이 되었습니까?

해결책

Problem solved by extensively tracing the simple code. It appears that the web directory was not writable by the server.

chmod 777 ./web # Solves it

Which bring me to these final questions:

  1. What should be the permissions and ownership of the web directory in a secured production environment ?

    From Maerlyn logs should be contained in a directory apart from the web apis directory.

  2. Where the errors are logged when the log service does not work, or when no log service is registered and we definitely needs the developers attention ? Is there any fallback low low level service ?

    From Maerlyn Look into your web server logs for those type of errors.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top