• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Magento 2.x 502 Bad Gateway Error on Ubuntu

mdraselkhan

New Pleskian
Hello,

I'm using AWS Lightsail Plesk Hosting Stack on Ubuntu. After installing Elaasticsearch 2.x that is mandatory to install Magento 2 on this same server, after successfully installed this, getting 502 Bad Gateway. The developer guy was told me to contact the server admin or OS system's license provider.

I use PHP 7.4, getting this error

{"0":"Notice: Trying to access array offset on value of type null in \/var\/www\/vhosts\/applogik.dk\/kamme.applogik.dk\/vendor\/magento\/framework\/App\/AreaList.php on line 78","1":"#1 Magento\\Framework\\App\\AreaList->getCodeByFrontName() called at [vendor\/magento\/framework\/App\/Http.php:111]\n#2 Magento\\Framework\\App\\Http->launch() called at [generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php:24]\n#3 Magento\\Framework\\App\\Http\\Interceptor->launch() called at [vendor\/magento\/framework\/App\/Bootstrap.php:261]\n#4 Magento\\Framework\\App\\Bootstrap->run() called at [index.php:39]\n","url":"\/index.php\/","script_name":"\/index.php","report_id":"79450960494d77faba9b567627cd0f085b1053a63e49ef9cd9ef3d13bfb67b26"}

If switch to php 8.0, getting this error

[Thu Feb 11 12:58:50.757032 2021] [proxy_fcgi:error] [pid 13308] [client 103.25.251.243:46740] AH01071: Got error 'PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36PHP message: PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /var/www/vhosts/applogik.dk/kamme.applogik.dk/vendor/magento/framework/Code/Reader/ClassReader.php on line 36', referer: https://kamme.applogik.dk/index.php/

Please help me to fix these issues. Thanks!
 
Olá,

Só leigo, mas pesquiso muito e comparo muito os detalhes ... Tradução e inglês não nativo, se você não entender me avise.

Partindo de um ponto, vi em outro post seu @mdraselkhan que veio do cPanel e eu vim do directadmin e funcionou corretamente (Magento 2.4.0).

Portanto, tenho certeza de que o erro está em alguma configuração de painel Plesk padrão

Se Magento 2.4.0 o erro aparece erro 500 ou erro 502, eu tive sucesso na mudança

Domínios> seu domínio> configurações nginx e Apache> desmarque "Restringir capacidade de seguir links simbólicos". Se for selecionado a partir do erro.

Sobre Magento 2.4.2

Erro 502 mesmo se você fizer isso, pelo menos não erro 500, se você desmarcar os links simbólicos.

No entanto, se você olhar para este magento, é OBRIGATÓRIO que você configure o Pub como pasta Root.

Domínios> seu domínio> Configurações de hospedagem> Documento raiz> <pasta magento> / pub

Você tem que fazer isso porque o root agora não tem mais os arquivos de índice e o .htaccess é diferente nesta versão 2.4.2, se parece com isto,

RewriteEngine em
RewriteCond% {REQUEST_URI}! ^ / Pub /
RewriteCond% {REQUEST_URI}! ^ / Configuração /
RewriteCond% {REQUEST_URI}! ^ / Atualizar /
RewriteCond% {REQUEST_URI}! ^ / Dev /
RewriteRule. * / Pub / $ 0 [L]
DirectoryIndex index.php

[USER = 173885] @Peter Debik [/ USER] desta forma, peço sua ajuda, se possível claro, ajude-nos a entender o que você precisa consertar no painel, pois é alguma configuração que só falta.
 
Hello,

Just a layman, but I research a lot and compare the details a lot ... Translation and non-native English, if you don't understand let me know.

Starting from one point, I saw in another post your @mdraselkhan that came from cPanel and I came from directadmin and it worked correctly (Magento 2.4.0).

So, I'm sure the error is in some standard Plesk panel configuration

If Magento 2.4.0 the error appears error 500 or error 502, I was successful in changing

Domains> your domain> nginx and Apache settings> uncheck "Restrict ability to follow symbolic links". If selected from the error.

About Magento 2.4.2

Error 502 even if you do this, at least not error 500, if you deselect symbolic links.

However, if you look at this magento, it is MANDATORY that you set up Pub as the Root folder.

Domains> your domain> Hosting settings> Root document> <magento folder> / pub

You have to do this because root now doesn't have the index files anymore and .htaccess is different in this version 2.4.2, it looks like this,

RewriteEngine em
RewriteCond% {REQUEST_URI}! ^ / Pub /
RewriteCond% {REQUEST_URI}! ^ / Configuração /
RewriteCond% {REQUEST_URI}! ^ / Atualizar /
RewriteCond% {REQUEST_URI}! ^ / Dev /
RewriteRule. * / Pub / $ 0 [L]
DirectoryIndex index.php


@Peter Debik this way, I ask for your help, if possible of course, help us understand what you need to fix on the panel, as it is some configuration that is just missing.
 
Back
Top