Closed nomuprive closed 2 years ago
Hi @williambize. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Magento only loads when .htaccess file is disabled. I have tried tracking the issue in vain. Any suggestion? Anyone had this issue before? How did you resolve that?
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hello @williambize,
Thanks for posting the issue!
But we need more information in order to reproduce the issue. Normally with Apache server if mod_rewrite is enabled the Magento instance is working fine. Please tell us more about the following:
Thanks
Hi @engcom-Hotel
Thanks for the reply.
I have finished updating Magento to version 2.4.0, successfully. But when I tried to access the webstore, it was giving 500 error. I troubleshoot so many things, including...
But nothing changed. So I renamed the .htaccess file and the site started loading. But when I enable the .htaccess again, the site started giving 500 error again. So I believe the issue is with the .htaccess file. I have gone through the entire .htaccess file to make sure everything is fine, including "RewriteEngine on".
Below is the content of the .htaccess file
`############################################
############################################
############################################
############################################
#AddType x-mapp-php5 .php
#AddHandler x-mapp-php5 .php
############################################
SetEnv MAGE_DEBUG_SHOW_ARGS 1
############################################
DirectoryIndex index.php
############################################
############################################
############################################
AddDefaultCharset Off
#AddDefaultCharset UTF-8
AddType 'text/html; charset=UTF-8' html
###########################################
RedirectMatch 403 /\.git
<Files composer.json>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files composer.lock>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .gitignore>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .htaccess>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .htaccess.sample>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .php_cs.dist>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .travis.yml>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files CHANGELOG.md>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files COPYING.txt>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files Gruntfile.js>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files LICENSE.txt>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files LICENSE_AFL.txt>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files nginx.conf.sample>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files package.json>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files php.ini.sample>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files README.md>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files magento_umask>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files auth.json>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .user.ini>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
ErrorDocument 404 /pub/errors/404.php ErrorDocument 403 /pub/errors/404.php
################################
#FileETag none
#
#
Enterprise Mode
throughout your company.#
`
Any suggestion?
Thanks
Hello @williambize,
The content of .htaccess seems fine to me. Can you please check the Apache logs when .htaccess is enabled?
Thanks
@engcom-Hotel below the content of the Web Server Error. For safety reasons, I have replaced the domain name with "example.com" and the cPanel account username with "cpanelaccountuser"
[Wed Mar 23 06:20:57.013140 2022] [core:alert] [pid 5670] [client 192.241.223.177:60610] /home/cpanelaccountuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration [Wed Mar 23 06:20:57.012912 2022] [core:alert] [pid 5670] [client 192.241.223.177:60610] /home/cpanelaccountuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration [Wed Mar 23 06:07:29.029473 2022] [core:alert] [pid 7591] [client 45.146.165.37:45042] /home/cpanelaccountuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration [Wed Mar 23 06:07:29.029176 2022] [core:alert] [pid 7591] [client 45.146.165.37:45042] /home/cpanelaccountuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration [Wed Mar 23 05:46:00.449621 2022] [core:alert] [pid 5670] [client 172.70.230.72:21566] /home/cpanelaccountuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration, referer: https://example.com/ [Wed Mar 23 05:46:00.449300 2022] [core:alert] [pid 5670] [client 172.70.230.72:21566] /home/cpanelaccountuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration, referer: https://example.com/ [Wed Mar 23 05:46:00.351960 2022] [core:alert] [pid 7589] [client 172.70.230.42:39918] /home/cpanelaccountuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration, referer: https://example.com/ [Wed Mar 23 05:46:00.351719 2022] [core:alert] [pid 7589] [client 172.70.230.42:39918] /home/cpanelaccountuser/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration, referer: https://example.com/
Hello @williambize,
As per looking into the logs, this issue may be due to the below line from the .htaccess file:
SetEnv MAGE_DEBUG_SHOW_ARGS 1
This may be due to mod_env not being installed on the server. Please try to install this Apache module and check if the issue has been resolved.
Thanks
Hi @engcom-Hotel Thanks for the support.
Unfortunately, installing mod_env
did not resolve the issue.
Thanks
Hello @williambize,
Actually I suggested you the solution according to the logs. Can you please check your error logs for any other error?
Thanks
@engcom-Hotel
There was a problem in the .htaccess file... there was a </IfModule>
without <IfModule>
. So I had to remove "" from one of the lines in the .htaccess file.
It appeared also that the cPanel account was not owning the folders and the files, so I ran the following command to make the user own the account, folders and files chown -Rv username:username /home/username/public_html
After doing the above things, the 500 error seems to change to a different error message. I started getting the following error This page isn’t working, shop.example.com is currently unable to handle this request. HTTP ERROR 500
So when I checked Apache errors, I found the following error: [Thu Apr 07 04:37:21.539071 2022] [core:crit] [pid 1807] (13)Permission denied: [client 185.189.182.234:41898] AH00529: /home/username/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/username/public_html/' is executable
The current error seems to be permission related, but I just run all the permission below and is still showing that 500 error message.
chmod -R 777 pub var find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \; find ./var -type d -exec chmod 777 {} \; 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 chmod u+x bin/magento
Hello @williambize,
This doesn't seems to be a Magento codebase issue. I request you to please check this with your hosting provider.
Thanks
Dear @williambize,
We have noticed that this issue has not been updated for a period of 14 Days. Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.
Regards
Magento only loads when .htaccess file is disabled. I have tried tracking the issue in vain. Any suggestion? Anyone had this issue before? How did you resolve that?