Hot answers tagged

19

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.php/your_admin_url try and let me know if you face any issue.


19

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 None Require all granted </Directory> to <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All ...


16

If you are using nginx configuration that comes with magento you need to put a file inside pub folder to allow access to it from the browser as pub is the document root of the vhost. Magento root dir is one level up. Second of all default config for nginx allows only to access index.php, get.php, static.php, report.php, 404.php and 503.php files. Any other ...


15

Nginx is definitely a good choice for hosting Magento, and it comes with a number of nice (but small) benefits that can help improve site performance. The main difference between Nginx and Apache is that Nginx uses non-blocking Evented IO, and Apache just uses multithreading/processing. What is the difference and why does it matter? Well in the case of ...


11

If you use the official Nginx config (nginx.conf.sample file in the Magento 2 distribution) then you need change the line 109 from : location ~ (index|get|static|report|404|503)\.php$ { to : location ~ (index|get|static|report|404|503|phpinfo)\.php$ { and place phpinfo.php to the pub subfolder because pub declared as document root at line 21: root $...


11

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 two different websites, and each website has two different store views as follows: Website 1 Website 1 (E-commerce) Website 1 (Venda Assistida) Website 2 ...


10

check "maintance.flag" file is present in root folder. If yes delete that file and refresh again. refer this Link


10

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-domen.com with content upstream fastcgi_backend { # socket # server unix:/var/run/php5-fpm.sock; server unix:/var/run/php/php7.0-fpm.sock; # use tcp connection ...


9

For example, to get 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('display_startup_errors', 1); ini_set('memory_limit', '5G'); error_reporting(E_ALL); use Magento\Framework\App\Bootstrap; require 'app/bootstrap.php'; $bootstrap = ...


7

Not through Turpentine, but you can run this command (as root/sudo) to flush just the homepage (may need to adjust if Magento is not installed at the top level of your site): varnishadm ban.url '^/(?:index\.php/?)?$'


7

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: fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE; fastcgi_param MAGE_RUN_TYPE $MAGE_RUN_TYPE;


7

Since Why does Magento POST to its own app/etc/local.xml? might not have been clear enough, I'll add this as an answer: Actually these messages are a good thing, Magento would warn you in the admin panel if it could access the file via HTTP. If you see this log message, everything is fine. Magento tries to access app/etc/local.xml via HTTP, which fails, so ...


7

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/magento2/var/session" Edited php.env file: 'session' => array ( 'save' => 'files', ), --> 'session' => array ( 'save' => '...


6

To answer your questions: 1. What exactly do Web Server Rewrites do? I believe they just remove the index.php from the url? How important are they? Correct, the remove the index.php for the URL to give you pretty URLs. Most modern websites and shops use them and I would recommend to do so. 2. Should this option be checked when using NGINX? Do Magento Web ...


6

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/bootstrap.php'; Then change $params value $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = '<store_name>'; $params[\Magento\...


6

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") { if (client.ip !~ purge) { return (synth(405, "Method not allowed")); } if (!req.http.X-Magento-Tags-Pattern) { return (synth(400, "X-Magento-Tags-...


5

This happens because we run both Apache and NginX on our servers to give you maximum performance. Apache handles the PHP code while NginX is used to serve static content such as images and javascript faster than Apache can. To install Magento enable "Skip Base URL Validation Before the Next Step" in the installation and your install should proceed without ...


5

Try this may be its use full to you. It solved my problem. Go to downloader/lib/Mage/Archive/Helper/File/Gz.php in your Magento directory and replace $this->_fileHandler = @gzopen($this->_filePath, $mode); with $this->_fileHandler = @gzopen64($this->_filePath, $mode);


5

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 line 8 of pastebin we can see the overflow keyword. ws = 0x7f285f09f0e0 { OVERFLOW The rest of the message refers to the backends response. So in the end what ...


4

Here is an example of your conf file that will work with more than one store map $http_host $magecode { hostnames; .domain1.com default; .domain2.com domain2_com; } server { listen 80 default; ## SSL directives might go here server_name www.domain1.com; root /var/www/domain1.com/current; if ($host !~* ^www\.) { ...


4

The best way is to do it at an apache or nginx level in the vhost configuration. No need to change Magento codebase for this. If you use apache, usually this is part of magento .htaccess, check this section: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{...


4

So after a long and hard look at what might be going wrong my colleague found the problem. There was code added to detect HTTP_X_FORWARDED_PROTO in the magento root index.php which is as following if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ) { $_SERVER['HTTPS'] = 'on'; $_SERVER['SERVER_PORT'] = 43; } This code would set https as on which makes ...


4

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: ############################################ ## Nginx proxy HTTPS Fix for Magento ## Source: https://www.sonassi.com/blog/magento-kb/magento-https-redirect-loop-2 SetEnvIf X-Forwarded-Proto https HTTPS=on See ...


4

I have faced same issue On my shared server. So what I did is open my env.php file and find array ( 'save' => 'files', ), and replace with (I created session folder in var directory of my magento) array ( 'save' => 'files', 'save_path' => 'var/session', ),


4

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 access Magento I got the error "There has been an error processing your request". I found the detailed error messages in the ./var/reports directory and they ...


4

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 really don't know why it works, so if anyone has suggestions for how to do this better (or even just an explanation for why it works this way) I'd love to hear it. ...


4

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 by HostingAdvice.com. To speed up Magento more, you should be using your build in caches, of course and you should consider using Varnish, which is available ...


4

Nginx config file with this much content: use this document link: http://devdocs.magento.com/guides/v2.2/install-gde/prereq/nginx.html I have tested on magento 2.2.0 ,nginx and os Ubuntu 16.04 upstream fastcgi_backend { server unix:/run/php/php7.0-fpm.sock; } server { listen 80; server_name www.magento-dev.com; ...


4

I've done a setup with Magento 2.2 and nginx before, but with subdomains instead of folders. So the setup was: nl.domain1.com, en.domain1.com,... nl.domain2.com, en.domain2.com,... etc. This is a modified version of the setup, maybe it helps you getting started. Another/additional idea: Create 2 nginx config files (one for each domain) and use alias for ...


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