Monday, April 10, 2017

Laravel 5.4 - 500 error after install

Yesterday I've installed a fresh CentOS 7 VM with Apache, MySQL and PHP 7.0.17.

After that, I installed composer and all other required php-packages.

Then I followed this guide to install Firefly-iii : https://firefly-iii.github.io/using-installing.html.

So far so good. The database is migrated and seeded from the php artisan migrate command.

Now the problem, when I try to access the application from the browser, a 500 error appears. No log rules, nothing.

Alright, this might be an permissions problem. I have changed the owner to apache:apache, no result. Set the storage and bootstrap/cache folder to 777 no result.

Alright... What now. Ah, maybe the user or usergroup is incorrect. I've copied my public/index.php and built in some try catch statement (still no log).

When I open the application in the browser finally some result is returned.

This try/catch:

try {
        $response = $kernel->handle(
            $request = Illuminate\Http\Request::capture()
        );
} catch (Exception $e){
        echo $e->getMessage();
        echo '<br/>';
        echo 'User: '.exec('whoami');
        echo '<br/>';
        echo 'Group: '.exec('groups');
        echo '<br/>';
}

returns the following result:

The stream or file "/var/www/html/application-folder/storage/logs/application-name-2017-04-06.log" could not be opened: failed to open stream: Permission denied
User: apache
Group: apache

After this message I've created the /var/www/html/application-folder/storage/logs/application-name-2017-04-06.log file and changed the permissions to 777.

Here is a little piece of my bash history :

[user@16 logs]$ sudo chmod 777 firefly-iii-2017-04-06.log
[sudo] password for user:
[user@16 logs]$ ls -l
-rwxrwxrwx+ 1 apache apache 5 Apr  6 14:18 firefly-iii-2017-04-06.log
[user@16 logs]$ chmod 777 firefly-iii-2017-04-06.log
chmod: changing permissions of ‘firefly-iii-2017-04-06.log’: Operation not permitted

This error messages is still returning and at this moment I've no idea what else I can try to fix this problem.

Does anyone knows a solution or has anybody else expecting this strange behavior?

Please help me, I am completely stuck at this moment and don't know what to do now and how I can solve this problem.



via Roy

Advertisement