Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fatal error with Monolog\Logger after FuelPHP 1.6 Windows installation
  • Hello,

    I've upgraded from FuelPHP version 1.4 to 1.6. I've downloaded 1.6. Copied core, package, and vendor folders, also copied public/index.php, ran composer update. When I try loading the site, I receive errors.

    Fatal error: Interface 'Psr\Log\LoggerInterface' not found in [path]\fuel\vendor\monolog\monolog\src\Monolog\Logger.php on line 28

    Fatal error: Call to a member function log() on a non-object in [path]\fuel\core\base.php on line 91

    Please advise. Thank you.

    Best,

  • HarroHarro
    Accepted Answer
    You haven't run Composer (or it failed to run properly), so the dependencies are not installed.

    Does composer tell you it has installed everything? What is in /fuel/vendor ?
  • I ran composer twice. First time the output was:

    -------------------------
    >php composer.phar update
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
      - Installing monolog/monolog (dev-master ae8500e)
        Cloning ae8500e5b1604963ee63d7bccd6c85808bfea974

    monolog/monolog suggests installing mlehner/gelf-php (Allow sending log messages
     to a GrayLog2 server)
    monolog/monolog suggests installing ext-amqp (Allow sending log messages to an A
    MQP server (1.0+ required))
    monolog/monolog suggests installing ext-mongo (Allow sending log messages to a M
    ongoDB server)
    monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages
     to a CouchDB server)
    monolog/monolog suggests installing raven/raven (Allow sending log messages to a
     Sentry server)
    Writing lock file
    Generating autoload files
    ------------------------------------------

    On a second ran it gave me:
    -----------------------------------------------
    >php composer.phar update
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Nothing to install or update
    Generating autoload files
    ---------------------------------------------

    I assume, this means that composer installed everything it should've.

    in /fuel/vendor/ there are the following folders:
    composer
    fuelphp
    monolog
    psr

    There is also /fuel/vendor/autoload.php file.

    It seems a bit odd that psr classes are in /fuel/vendor/psr/log/Psr/Log

  • P.S.
    I accidentally clicked "Accept" on the first reply. The issue is still not resolved.
  • Resolved. It was file permission issue.
    composer update executed successfully, but after that I had to give web user read permission to Psr\Log\ folder.
  • Ok, good to hear you've resolved the issue.

    The folder structure of the composer packages is defined by PSR-0.

    The first two entries are the vendor (psr) and the package (log) name, used to make sure the package is unique. Inside the package you need a one-to-one mapping between the namespace and the folder structure. Since the namespace is \Psr\Log, these are the two next folders you see.

    There is a discussion going on in the FIG to create a new version of PSR-0 that will eliminate the additional two folders.
  • Thanks for the answers, Harro!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion