Skip to main content
29 votes
Accepted

Magento 2 PHP extensions missing

Before you install Magento 2, make sure your system meets or exceeds the following requirements: Required PHP extensions: PDO/MySQL mbstring mcrypt mhash simplexml curl gd2, ImageMagick 6.3.7 (or ...
Vadym Kalin's user avatar
  • 1,257
28 votes
Accepted

How to display Yes/No values in admin grid (Magento2)?

Method 1: If you have boolean value 0 and 1 use default option class Magento\Config\Model\Config\Source\Yesno app/code/Vendor/Theme/view/adminhtml/ui_component/your_ui_grid.xml <column name="...
Prince Patel's user avatar
  • 22.8k
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
24 votes
Accepted

Magento 2.1.1 not compatibile with PHP 7.1.0

Update - September 2017: Magento 2.2 now officially supports PHP 7.1, so that's the Magento version you should aim for from now on if PHP 7.1 is something you want or need on your platform. Original ...
TiEul's user avatar
  • 1,297
20 votes

Classnames 'Void' inside vendor/magento/

Here is how to fix it: edit vendor/magento/module-sales/etc/webapi.xml line 112: - <route url="/V1/invoices/:id/void" method="POST"> + <route url="/V1/invoices/:id/voidInvoice" method="POST"...
Konstantin Gerasimov's user avatar
20 votes

Error when mass updating Attributes

A flaw in the migration script left the setting empty for: Stores -> Settings: Configuration -> Catalog -> Inventory -> Product Stock Options: Minimum Qty Allowed in Shopping Cart Change ...
siddiqui's user avatar
  • 321
15 votes
Accepted

How we can install magento 2.2.0 via command line comand?

php bin/magento setup:install --backend-frontname="admin" --key="admin" --session-save="files" --db-host="localhost" --db-name="magento_2_db" --db-user="root" --db-password="root" --base-url="http://...
Pramod Kharade's user avatar
13 votes
Accepted

Magento 2 - How do I programmatically remove payment method?

We will describe a simple solution based on the Payment Restriction module, where MageWorx – a vendor name and Payment Restriction – a module name. First, you need to create a directory for the ...
Mageworx's user avatar
  • 3,566
13 votes

The each() function is deprecated. Magento 2 , php 7.2

each() function is deprecated in php 7.2 so change this function to foreach() Change while (list($name, $value) = each($options)) { $this->setOption($name, $value); } To foreach ($options as $...
Surendra Kumar Ahir's user avatar
12 votes
Accepted

Return bool gives error "Invalid return type" for Ajax Controller

Try this example: protected $resultJsonFactory; /** * @param Context $context * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory */ public function __construct( ...
Siarhey Uchukhlebau's user avatar
11 votes

Undefined class constant 'PDO::MYSQL_ATTR_SSL_KEY' in/magento/setup/src/Magento/Setup/Model/ConfigOptionsList.php:179 in magento localhost

Could make sure that you have installed the php-pdo and php-mysql packages? Maybe you have different PHP versions installed. Check first which PHP version you are using php --version then install ...
Darokthar's user avatar
  • 309
10 votes
Accepted

Magento 2: installation stuck at 65% "installing user configuration"

Thanks to @Nickool, I found out apache mod_rewrite was not enabled. So I ran: sudo a2enmod rewrite Added the following lines to my /etc/apache2/sites-available/my.host.com <Directory /var/...
Raphael at Digital Pianism's user avatar
10 votes
Accepted

Enable php extension for installation Magento2 on Xampp

Check php.ini file. This is normally under your xampp folder (Example D:\xampp\php) Search like php_soap.dll;,php_xsl.dll,php_intl.dll each dll extension removing the first ; character, to make it ...
Rama Chandran M's user avatar
9 votes
Accepted

Why doesn't Magento 2.1 support PHP 7.0.3 to 7.0.5?

No official information but this Github issue gives a hint: https://github.com/magento/magento2/issues/4070 alankent commented on 8 Apr Could you try 7.0.4? There are reports of something breaking ...
Fabian Schmengler's user avatar
9 votes

Magento 2.1.1 not compatibile with PHP 7.1.0

There are two possibilities: The devdocs are wrong and PHP 7.1 is not supported The requirement in composer.json is wrong. Since Magento 2.1 was released before PHP 7.1, it is most likely option (2) ...
Fabian Schmengler's user avatar
9 votes

What type of redirect is this?

If you need to know detail about the following code then read the following: $resultRedirect->setPath('*/*/'); First * means current route and second * means current controller. Let me explain it ...
Sukumar Gorai's user avatar
9 votes

How to update magento 2.3.0 to 2.3.1?

Yes, you can upgrade via admin as well, To run System Upgrade: Log in to the Magento Admin as an administrator. Click System > Tools > Web Setup Wizard. The following page displays. Click System ...
Prathap Gunasekaran'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
8 votes

The each() function is deprecated. Magento 2 , php 7.2

Magento 2 does not support PHP 7.2 until version 2.3 which is not out yet (rumour is it'll be out by the end of 2018). So your only real option here is to downgrade to the latest supported version of ...
Gareth James's user avatar
8 votes
Accepted

Magento 2 : How to get the best seller product collection?

Please try this code to get best seller product collections using objectManager. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $productCollection = $objectManager->create('...
Aasim Goriya's user avatar
  • 5,454
8 votes

How to update magento 2.3.0 to 2.3.1?

Upgrade Magento version 2.3.0 to 2.3.1 follow below steps: Magento 2 Version Upgrade Commands. 1) php bin/magento maintenance:enable 2) composer require magento/product-community-edition 2.3.1 --no-...
Kirti Nariya's user avatar
  • 3,071
8 votes

Error browsing simple products 2.3.1

You can remove generated directory using this command, because you've disabled that module but some code which is generated in generated/code/ directory which is still available there. So you need to ...
Kishan Savaliya's user avatar
7 votes
Accepted

How to add custom block in admin order create form in magento 2.2.5

First,you have to create a custom module.On your custom Create sales_order_create_index.xml at app/code/{VendorName}/{ModuleName}/view/adminhtml/layout/ and add below code: <?xml version="1.0"?&...
Amit Bera's user avatar
  • 77.6k
7 votes

Magento2 : How to add Custom Block?

Create a module with name Vendor_Module by following below steps: Step 1: Create registration.php app/code/Vendor/Module/registration.php <?php \Magento\Framework\Component\ComponentRegistrar:...
Sukumar Gorai's user avatar
7 votes
Accepted

How to Disable Module on the basis of configuration Values in Magento 2

syetm.xml file add custom filed for module configuration system.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
Shailesh Katarmal's user avatar
6 votes
Accepted

rewrite model not working

As per as, your code you want to rewrite class Mage_Customer_Model_Customer. But in config.xml, you try to rewrite model class Mage_Customer_Model_Product and in default magento this class does not ...
Amit Bera's user avatar
  • 77.6k
6 votes
Accepted

Cannot create new user account - Magento 2

I had a similar issue and it turned out I'd missed a form key in the Magento_CustomerCustomAttributes module override : Magento_CustomerCustomAttributes/templates/customer/form/register.phtml I'd ...
Frank's user avatar
  • 1,144
6 votes

How we can install magento 2.2.0 via command line comand?

Yes, You can install using Command. Magento 2 has ability do that: php bin/magento setup:install --base-url=http://127.0.0.1/magento2/ \ --db-host=localhost --db-name=magento --db-user=magento --db-...
Amit Bera's user avatar
  • 77.6k
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

You must have installed GD library with --with-jpeg-dir=DIR option

Need to install GD library Run the below command on cmd sudo apt-get install php7.1-gd sudo service apache2 restart change php7.1 according to your current php version
Surendra Kumar Ahir's user avatar

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