Hot answers tagged

26

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.


23

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 ...


21

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 ...


15

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 $...


14

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 = ...


14

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 ...


12

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 ...


12

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 number: For example 2 After switching below command used to restart the PHP and Nginx server. sudo service nginx restart sudo service php7.1-fpm or php7.2-fpm ...


11

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


10

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' => '...


9

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;


8

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 this issue by modifying this file /etc/nginx/nginx.conf add this line of codes inside http{} fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; ...


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

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

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-...


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\...


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

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 ...


5

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 ...


5

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. ...


5

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 ...


5

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 www.example.com:9000 in your case: localhost:3307


5

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 install homebrew/php/php71 Install Composer brew install homebrew/php/composer Install Valet+ by weprovide composer global require weprovide/valet-plus Add export ...


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 ...


5

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 of the default configuration file and then open it up in your favourite text editor. $ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default....


5

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 vcl_deliver procedure. The vcl_deliver is what you use in Varnish for controlling the output to the clients (e.g. browsers). How long Varnish will cache things ...


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