cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.1.9 Installation error 500

Magento 2.1.9 Installation error 500

I successfully installed Magento, but couldn't see link to activate my custom theme. I'm on a shared Linux environment. So, I asked the hosting provider to run the upgrade command:

php bin/magento setup:upgrade

After running the command, the server started generating error 500 for for app/etc directories. So, my next attemt was to try to set proper permissions.

 

find . -type f -exec chmod 644 {} \; // 644 permission for files
find . -type d -exec chmod 755 {} \; // 755 permission for directory
find ./var -type d -exec chmod 777 {} \; // 777 permission for var folder
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown -R :<web server group> .
chmod u+x bin/magento

But the host stated that they couldn't run 0777, because their server runs on suPHP, that they use 0755 for directories and 0644 for files. Upon running the other commands, that didn't solve the problem.

 

Then I asked the host again to run this command:

php bin/magento setup:static-content:deploy en_GB en_US

 Upon doing that, the following error message appeared, while navigating to every page:

An error has happened during application run. See exception log for details.

Using the "Inspect Element" tool in my browser shows "200 OK" HTTP status code.

 

 From my research, there's a recommendation to check

/vendor/magento/framework/Filesystem/DriverInterface.php (WRITEABLE_DIRECTORY_MODE and WRITEABLE_FILE_MODE)

/lib/internal/Cm/Cache/Backend/File.php (directory_mode and file_mode)

The following is what I have in DriverInterface.php:
   

const WRITEABLE_DIRECTORY_MODE = 0770;

    /**
     * Permissions to give read/write access to owner and owning group, but not to all users
     *
     * @deprecated
     */
    const WRITEABLE_FILE_MODE = 0660;

And createDirectory function has 0777 permission:
public function createDirectory($path, $permissions = 0777);

My Magento installation doesn't have:

/lib/internal/Cm/Cache/Backend/File.php
 
Please, advise me on what to do next. Thanks.

 

Please, does anyone know how to resolve this issue and why my custom theme didn't display for customization?

 

Thank you all once again in advance for your help.

 

 

10 REPLIES 10

Re: Magento 2.1.9 Installation error 500

Hi @FlamyTech,

 

Can you sahre the full detail of the error 500?

Re: Magento 2.1.9 Installation error 500

Unfortunately, the error log is now empty, but when the issue occurred, anytime I tried to access any page of the website using Google Chrome, the following error message would be displayed:
"This page isn’t working

www.example.com

 is currently unable to handle this request.
HTTP ERROR 500"

Like I stated earlier in my post, the current issue is whenever I try to access my website, I see the following error message:

An error has happened during application run. See exception log for details.

 

Re: Magento 2.1.9 Installation error 500

Hi @FlamyTech,


Ok, but did you checked the system.log and exception.log files?

Re: Magento 2.1.9 Installation error 500

@Damian Culotta,

Thanks for your continued interest.

 

Like I stated earlier in my post, I'm on a shared Linux hosting environment, and I can't find the system.log and exception.log files. I guess they're hidden by default to clients in shared accounts.

Re: Magento 2.1.9 Installation error 500

Hi @FlamyTech,

 

Into your Magento directory, take a look for these directories/files:

 

  • /pat/to/your/magento/var/log/system.log
  • /pat/to/your/magento/var/log/exception.log
  • /pat/to/your/magento/var/log/debug.log

 

Re: Magento 2.1.9 Installation error 500

@Damian Culotta

A million thanks. What a pointer!

 

The system log has lots of processed information. The only issue I noticed in the system.log is as follows:

main.CRITICAL: Broken reference: No element found with ID 'header.links'. [] []

Please, do you have any idea what that means and how to fix it?

 

The exception.log states that:

pub/static/frontend/Vendor/theme/en_GB/mage/requirejs/mixins.min.js): failed to open stream: No such file or directory in /home/my_username/public_html/vendor/magento/framework/Filesystem/Driver/File.php:149

and secondly that:

RuntimeException: Can't create directory /home/my_username/public_html/var/generation/Magento/Framework/App/Response/Http/. in /home/my_username/public_html/vendor/magento/framework/Code/Generator.php:115

The debug.log has lots of data I can't decipher what they mean.

 

There might be other issues, other that those mentioned above, but I 'haven't noticed them. If it's necessary, I can send you the log files.

Re: Magento 2.1.9 Installation error 500

Hi @FlamyTech,

 

The problem seems to be in the last log. There's an issue with your files/directories permissions and Magento can't create the var/generation files.

You should fix the permissions and then everything should work normally.

Re: Magento 2.1.9 Installation error 500

@Damian Culotta,

Thanks for your continued support.

 

Like I stated earlier, my web host informed me that their server runs on suPHP and hence, cannot run the 777 command like this:

find . -type f -exec chmod 644 {} \; // 644 permission for files
find . -type d -exec chmod 755 {} \; // 755 permission for directory
find ./var -type d -exec chmod 777 {} \; // 777 permission for var folder
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown -R :<web server group> .
chmod u+x bin/magento

They use 755 for folders and 644 for files. But with that as the permissions are with 755 and 644, my site doesn't load. So, what should be the proper permissions for folders and files, respectively? Giving me the commands would be mush appreciated.

 

I reiterate my appreciations for your help. Thanks.

Re: Magento 2.1.9 Installation error 500