Magento – 500 Internal Server Error – Fresh Install

installationmagento2PHP

I just setup a fresh install of cpanel.
Uploaded magento package – tested both.
Magento-CE-2.1.6-2017-03-29-12-40-05
Magento-CE-2.0.13-2017-02-20-06-04-35
tried php 56, 57,70
move .htacess
Verified I could get the html files.
Opened a ticket with cpanel for help.

Error Below.

Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator at
webmaster@magento.************.com to inform them of the time this
error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error
log.

Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.

Best Answer

[Wed May 17 15:49:56.848543 2017] [core:alert] [pid 981] [client 208.74.121.106:23024] /home/aemadminuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration
[Wed May 17 15:49:56.849866 2017] [core:alert] [pid 981] [client 208.74.121.106:23024] /home/aemadminuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration
[Wed May 17 15:49:57.067999 2017] [core:alert] [pid 3839] [client 208.74.121.106:23074] /home/aemadminuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration, referer: http://magento.*********.com/index.php
[Wed May 17 15:49:57.069328 2017] [core:alert] [pid 3839] [client 208.74.121.106:23074] /home/aemadminuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration, referer: http://magento.*********.com/index.php

This appears to be due to the following line within your .htaccess:

[15:50:19 aem root@8483997 /home/aemadminuser/public_html]cPs# grep SetEnv /home/aemadminuser/public_html/.htaccess
SetEnv MAGE_IS_DEVELOPER_MODE "true"

This is due to mod_env not being installed on the server. You can install this Apache module via WHM by navigating to EasyApache 4 under the Apache Modules. If you would like I would be more than happy to assist with enabling this module however you will need to ensure that our IP addresses are able to successfully access WHM. I have included these IP addresses for you below:

Couldn't access - bug with apacheeasy4

via the command line:

Installing:

ea-apache24-mod_env | x86_64
2.4.25-9.9.2.cpanel | EA4 27k

Upon completion I no longer received any errors within the Apache error_log however there was still an HTTP 500 error being generated by the Magento script. This contained the following error:

[17-May-2017 23:37:59 UTC] PHP Fatal error:  Uncaught exception 'Zend\Stdlib\Exception\RuntimeException' with message 'No wrapper found supporting "UTF-8"' in /home/aemadminuser/public_html/vendor/zendframework/zend-stdlib/src/StringUtils.php:135

With a bit of research, I was able to determine that this was due missing the mbstring PHP extension. I went ahead and installed this and now both the URLs are loading without any errors:

Installing:

ea-php56-php-mbstring | x86_64                     
5.6.30-12.12.1.cpanel | EA4 523 k

my site now loads.

Related Topic