28 votes

404 not found error for admin page

Please try Below steps Delete var/cache folder Go to database SELECT * FROM core_config_data WHERE path = 'web/seo/use_rewrites' and make it 0 Then enter url in your browser magento_base_url/index....
Murtuza Zabuawala's user avatar
28 votes

404 not found error for admin page

For Linux edit the file /etc/apache2/apache2.conf To edit this file use sudo vi /etc/apache2/apache2.conf command <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride ...
Prince Patel's user avatar
  • 22.7k
26 votes
Accepted

How to switch between PHP versions on Ubuntu Nginx

Please use to below command sudo update-alternatives --config php After run above command select the PHP version that you need to use. Press to keep the current choice[*], or type selection ...
Kamlesh Solanki's user avatar
21 votes

How do I run php custom script on magento2

For example, to get a product name by the custom script Example 1: Create test.php at the root of Magento var/www/html/magento2/test.php <?php ini_set('display_errors', 1); ini_set('...
Prince Patel's user avatar
  • 22.7k
21 votes

How to Solve 502 Bad Gateway error in Nginx Magento 2?

I installed the magento2 when I am trying to open some pages facing 502 nginx issue, in nginx logs it is showing upstream sent too big header while reading response header from upstream, then solved ...
Arshad Syed's user avatar
15 votes
Accepted

How to configure nginx for Magento 2?

Magento2 contains NGINX config nginx.conf.sample that can be included in you server section. Let's try with minimal configuration; You need to modify /etc/nginx/sites-available/my-domain.com with the ...
KAndy's user avatar
  • 20.8k
15 votes

Magento 2: How to configure Nginx to use multiple websites with sub-folder

I have tried numerous ways to achieve this task. I would like to thank @matias-hidalgo for his contributions, although I did not understand his answer at first read :). Here is the scenario. We have ...
Bunyamin Inan's user avatar
11 votes

Configure Nginx to single MAGENTO instance for running multiple stores (domains)

at http{ } block: map $request_uri $MAGE_RUN_CODE { default en; ~^/fi/ fi; } map $request_uri $MAGE_RUN_TYPE { default store; ~^/fi/ store; } at php${ } block: ...
MagenX's user avatar
  • 3,820
11 votes
Accepted

Install Magento 2 on different mysql port

http://devdocs.magento.com/guides/v2.2/install-gde/install/cli/install-cli-install.html --db-host=localhost:3307 Note: You can optionally specify the database server port in its host name like ...
MagenX's user avatar
  • 3,820
11 votes

Magento 2: Failed to set ini option “session.cookie_samesite” to value “Lax” when updating to - 2.3.6-p1

The session.cookie_samesite PHP INI is available starting from PHP 7.3. If you're getting this error, it's because you are not running PHP 7.3 or above and Magento code you run is not compatible/buggy ...
Danila Vershinin's user avatar
10 votes
Accepted

Magento -site not opening after CLI -installation

So this solved this for me, thank you @Steve Johnson. Edited php.ini file: session.save_handler = files ;session.save_path = "/tmp" --> session.save_handler = files session.save_path = "var/www/...
MyrkkyMies's user avatar
9 votes

404 not found error for admin page

Why nobody talk about ? bin/magento info:adminuri This will display your adminuri. More info can be found here.
snoob dogg's user avatar
9 votes

How to switch between PHP versions on Ubuntu Nginx

For Nginx, we simply need to update the PHP-FPM socket in its configuration file. But before that make sure that the PHP-FPM is installed for your version and is running as a service. Take a backup ...
Prathap Gunasekaran's user avatar
9 votes
Accepted

How to enable CORs to access Magento rest APIs : Magento2

Nginx Not pass Access-Control-Allow-Origin by using below module it will pass the header in API It can update from Store >> Config >> General >> WEb Change * to any url you want to ...
Ketan Borada's user avatar
  • 2,603
8 votes

How to Solve 502 Bad Gateway error in Nginx Magento 2?

Are you using NGINX? It seems there is misconfiguration with your server. Try to add: http { .... your config ... fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; } Restart NGINX and after, ...
mrDinkelman's user avatar
8 votes

Upstream sent too big header while reading response header from upstream

In my case fresh magento 2.4.1 (nginx on ubuntu) solution (by David Lambauer) worked: In terminal: cd /etc/nginx/sites-available/ ls Open your nginx config file: code magento24.local.config Find &...
Jakub Ujvvary's user avatar
7 votes
Accepted

Magento 2.1 Varnish Cache not Purge

Finally I fixed myself the issue. env.php 'http_cache_hosts' => array ( 0 => array ( 'host' => '127.0.0.1', 'port' => '80', ), ), default.vcl if (req.method == "PURGE") { ...
George George's user avatar
7 votes
Accepted

How to set page cache expires to 7 days?

At present I see the expires is set to -1 The Expires header you see is client-side. Browsers should not cache things like product pages, etc. which is why the default Magento VCL sets it to -1 in ...
Danila Vershinin's user avatar
6 votes

How do I run php custom script on magento2

If you want to allow more than one php script to be executable like I need (import.php for ERP import product, stock.php for update the inventory with my ERP etc...) : create a new directory scripts ...
cap340's user avatar
  • 711
6 votes

404 not found error for admin page

I also had this issue, it turned out one of my URLs was set to the IP address and not to the domain name so going to the {domain}/admin was returning not found. Solution was to run php bin/magento ...
Bart's user avatar
  • 161
6 votes

How to run Magento 2 from a subdirectory

If you are trying to create a store only then you need to copy index.php and .htaccess from main website and then change path of require __DIR__ . '/app/bootstrap.php'; To require '../app/...
Ronak Chauhan's user avatar
6 votes
Accepted

How do I install Magento 2 on Mac OSX with Laravel Valet?

I have recently installed Magento 2 on Valet+ on my Mac. Here are the steps I have taken to successfully install it: Install Homebrew if you don't have it on your Mac already Install PHP 7 brew ...
Kalpesh's user avatar
  • 2,325
6 votes

Upstream sent too big header while reading response header from upstream

Magento2 always have the issues with the response size. since you can solve it by enabling the cache which all recommended. Can you please try the below setup in nginx configuration to your location ...
N.ameen's user avatar
  • 386
5 votes

Magento -site not opening after CLI -installation

Thank you so much this also helped me fix my problem... I had used the free Softaculous Installer via my cPanel to install Magento v2.2.6 It said the installation was successful but when trying to ...
Sandra Bastow's user avatar
5 votes

404 not found error for admin page

Check if admin/url/custom is empty and admin/url/use_custom is set to 0.
Pancake's user avatar
  • 51
5 votes

How to run Magento 2 from a subdirectory

Thanks to everyone who answered, I kept throwing your suggestions and other changes at the system and eventually arrived at a configuration that worked. I'm not in love with this solution, and I ...
Ben's user avatar
  • 231
5 votes
Accepted

Nginx or Apache for Magento 2.x

I'd go for Nginx, because this is faster then Apache. There are several benchmarks on the internet about the differences and the pros and cons of them. I'd suggest to read some of them, like this one ...
Arjen Miedema's user avatar
5 votes
Accepted

Magento 2: How to configure Nginx to use multiple websites with sub-folder

What about a pure nginx solution with this double map ? First, for the web site (thanks @MagenX) map $request_uri $MAGE_RUN_CODE { default website1; ~^/website1/.* website1; ~^/website2/...
Petit_Nuage's user avatar
5 votes
Accepted

Magento 2+nginx+varnish cannot serve same page multiple times, resp 502

I ended up reaching the #varnish channel on IRC and ask for help in case a guru helps me out. So a guy called "guillaume" reached out and pointed out the error. If we inspect the panic.show log on ...
1337_sanc's user avatar
  • 389
5 votes
Accepted

Upstream sent too big header while reading response header from upstream

Coming back after a year, I don't have this issue anymore. I can't exactly explain the final solution but regarding the fastcgi parameters, I can tell that the following params work fine and are also ...
David Lambauer's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible