FuelPHP 1.5.1: Fatal error: Call to a member function log()

I installed FuelPHP v1.5.1 earlier today with a manual installation (i.e. extraction) rather than with the oil command-line utility. As I tried to access the website in a browser, I got the following error message:

Fatal error: Call to a member function log() on a non-object in /var/www/fuelphp-1.5.1/fuel/core/base.php on line 91

Now, this was a known bug so I looked up a workaround, which involved a couple of extra lines to the instance method of log.php. The change displayed yet another error message, which makes more sense:

Fatal error: Uncaught exception ‘Fuel\Core\PhpErrorException’ with message ‘mkdir(): Permission denied’ in /var/www/fuelphp-1.5.1/fuel/packages/log/classes/log.php:56 Stack trace: #0 /var/www/fuelphp-1.5.1/fuel/core/bootstrap.php(48): Fuel\Core\Error::error_handler(2, ‘mkdir(): Permis…’, ‘/var/www/fuelph…’, 56) #1 [internal function]: {closure}(2, ‘mkdir(): Permis…’, ‘/var/www/fuelph…’, 56, Array) #2 /var/www/fuelphp-1.5.1/fuel/packages/log/classes/log.php(56): mkdir(‘/var/www/fuelph…’, 511, true) #3 /var/www/fuelphp-1.5.1/fuel/packages/log/classes/log.php(83): Log\Log::_init() #4 /var/www/fuelphp-1.5.1/fuel/core/base.php(91): Log\Log::instance() #5 /var/www/fuelphp-1.5.1/fuel/core/classes/error.php(27): logger(400, ‘2 – mkdir(): Pe…’) #6 /var/www/fuelphp-1.5.1/fuel/core/classes/error.php(110): Fuel\Core\PhpErrorException->handle() #7 /var/www/fuelphp-1.5.1/fuel/core/bootstrap.php(42): Fuel\Core\Error::exception_handler(Object(Fuel\Core\PhpErrorException)) #8 [internal function]: {closure}(Object(Fuel\Core\Php in /var/www/fuelphp-1.5.1/fuel/packages/log/classes/log.php on line 56

This pointed me to the source of the error, which boils down to filesystem permissions. As a part of the manual installation process, I had to provide write access to the tmp, cache, log, and config directories within the fuel/app directory – a step that apparently slipped my mind. Oh well, at least I was able to point the other folk on the project to the source of an error that had its own ticket.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s