Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fatal Error
  • can someone please tell me what's the problem with this, cause i have tried tings like chmod -R 777 and nothing, this is my error:

    Fatal Error!



    ErrorException [ Fatal Error ]:
    Uncaught exception
    'Fuel\Core\FuelException' with message 'Unable to create or write to
    the log file. Please check the permissions on
    /var/www/html/blog/fuel/app/logs/. (mkdir(): Permission denied)' in
    /var/www/html/blog/fuel/core/classes/log.php:77
    Stack trace:
    #0 [internal function]: Fuel\Core\Log::_init()
    #1 /var/www/html/blog/fuel/core/classes/autoloader.php(364):
    call_user_func('Log::_init')
    #2 /var/www/html/blog/fuel/core/classes/autoloader.php(247):
    Fuel\Core\Autoloader::init_class('Log')
    #3 [internal function]: Fuel\Core\Autoloader::load('Log')
    #4 /var/www/html/blog/fuel/core/base.php(98): spl_autoload_call('Log')
    #5 /var/www/html/blog/fuel/core/classes/error.php(120): logger(400,
    'Error - date_de...')
    #6 /var/www/html/blog/fuel/core/bootstrap.php(82):
    Fuel\Core\Error::exception_handler(Object(Fuel\Core\PhpErrorException))
    #7 [internal function]: {closure}(Object(Fuel\Core\PhpErrorException))
    #8 {main}
    thrown



    COREPATH/classes/log.php @ line 77



    72            $handle fopen($filename'a');
    73        }
    74        catch (\Exception $e)
    75        {
    76            \Config::set('log_threshold', \Fuel::L_NONE);
    77            throw new \FuelException('Unable to create or write to the log file. Please check the permissions on '.\Config::get('log_path').'. ('.$e->getMessage().')');
    78        }
    79
    80        if ( ! filesize($filename))
    81        {
    82            fwrite($handle"<?php defined('COREPATH') or exit('No direct script access allowed'); ?>".PHP_EOL.PHP_EOL);

  • Pretty obvious.

    mkdir(): Permission denied

    Your webserver user doesn't have the rights to create a new directory in the APPPATH logs folder.

    It is a rights issue.
  • Run the oil install command.
    From the root directory "php oil refine install"
    If you get permission denied, you need to be root perhaps.


  • thanks mikepmtl but i have already tried that and still same error, even i tried chmod 777 or 775 and always the same
  • Tell me more about the environment yo are on please.

    Linux, Mac, Windows.
    Location of the project root.

    If Linux are you running with SELinux enabled?

    If Windows (local) is your project under your user name?

    Did you look in all the logs....

    fuels/app/logs
    /var/log


  • The error messages are linux, and I can remember from an earlier conversion with @codeyad this is about Fedora. Which is my OS of choice and with which I have no issue.

    SE linux is very good, hadn't thought of that. I never enable that on my desktops, but I do on all servers, and with Apache and non-standard locations it's a nightmare. If that is on, check your /var/log/audit/audit.log, or run an audit2allow on it to define the missing policies.
  • +1 Fedora!   :)


  • In case anyone else encounters this with SELinux, here's how to fix it.

    First, check to see if it's enabled:
    # sestatus
    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    SELinux root directory:         /etc/selinux
    Loaded policy name:             targeted
    Current mode:                   enforcing
    Mode from config file:          enforcing
    Policy MLS status:              enabled
    Policy deny_unknown status:     allowed
    Max kernel policy version:      29

    If it is, set the policy on the directories that FuelPHP needs writeable (this is executed from the app folder):
    # chcon -R -t httpd_sys_content_rw_t cache
    # chcon -R -t httpd_sys_content_rw_t config
    # chcon -R -t httpd_sys_content_rw_t logs
    # chcon -R -t httpd_sys_content_rw_t tmp

Howdy, Stranger!

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

In this Discussion