29
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 ...
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....
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 ...
22
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('...
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 ...
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 ...
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 ...
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 ...
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/...
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.
9
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, ...
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 ...
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 ...
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 &...
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") {
...
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 ...
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 ...
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 ...
6
votes
404 not found error for admin page
Check if admin/url/custom is empty and admin/url/use_custom is set to 0.
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/...
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 ...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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 ...
5
votes
Accepted
Purge specific Link from Magento 2 Varnish
The result of your curl command would help?
If empty try adding -I.
Solution from the comments:
Add any or both of the mentioned headers in your curl.
curl -X PURGE -H 'X-Magento-Tags-Pattern: .*' ...
4
votes
Magento2 with Varnish 4 and Nginx as SSL termination ends in mixed content
If you're having issues with Magento not detecting the HTTPS redirect, you can add this to your the Magento .htaccess file located in your docroot:
############################################
## ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
nginx × 398magento2 × 187
varnish × 58
magento-1.9 × 51
php × 23
apache × 22
centos × 21
magento2.3 × 19
url-rewrite × 18
php-7 × 18
server-setup × 17
php-fpm × 17
redirect × 16
magento-2.1 × 14
multistore × 14
installation × 14
admin × 12
ssl × 11
https × 11
magento-1.8 × 10
database × 10
error × 10
magento2.4 × 9
cache × 8
configuration × 8