Skip to main content
16 votes
Accepted

Magento 2.3 : How to create product attribute via declarative schema?

I wrote an entire blog post about this. It is quite extensive and goes into detail about all of the intricacies: https://markshust.com/2019/02/19/create-product-attribute-data-patch-magento-2.3-...
Mark Shust at M.academy's user avatar
13 votes
Accepted

Magento 2 : Running magento 2 on windows using windows subsystem for Linux (WSL)

Introduction: The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows, alongside your traditional Windows desktop ...
Vivek Kumar's user avatar
  • 5,740
11 votes
Accepted

How to convert install/upgrade schema scripts to db_schema.xml files?

After writing my question. I found my issue: I had run the setup upgrade command before. So, I removed my module from setup_module table and my custom data table. Then I ran the two commands again. ...
Khoa TruongDinh's user avatar
10 votes
Accepted

Specific order for patch

To define a dependency in a patch, add the method public static function getDependencies() to the patch class and return the class names of the patches this patch depends on. The dependency can be in ...
Alex Lobster's user avatar
9 votes

There are no commands defined in the "setup:static-content" namespace

first run the cmd composer install in you folder then run this cmd php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy (or) php bin/magento ...
SNS's user avatar
  • 915
8 votes
Accepted

Blank page instead of setup When install Magento2

Follow this Commands : php bin/magento setup:install --base-url="YourSiteUrl" --db-host="DBhost" --db-name="DBName" --db-user="DBuser" --db-password="DBpassword" --admin-firstname="admin" --admin-...
Prashant Patel's user avatar
7 votes

Magento setup directory cannot be accessed

Appending /setup to the install URL should resolve the issue. In your case that would be http://localhost/~myusername/magento/setup
Andrew B's user avatar
7 votes
Accepted

Composer installation fails with "failed to open stream: Too many open files"

You can up your system's file open limit on Linux or Max OS with the following: ulimit -n 10000 This should help with the composer issue.
David Manners's user avatar
6 votes
Accepted

Magento 2 add data to core_config_data

In your setup script: $data = [ 'scope' => 'default', 'scope_id' => 0, 'path' => 'design/footer/copyright', 'value' => 'Copyright © 2016 ...
Khoa TruongDinh's user avatar
6 votes

How to change the column in core table in magento 2

You can Modify the definition by upgrade script as below. <?php namespace Vendor\Module\Setup; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface;...
Mohammad Mujassam's user avatar
6 votes
Accepted

phpcs Use ::class notation instead warning on attribute source field

Strings can contain typos. You can not use the "jump to class" feature on strings from your IDE. Refactoring in an IDE will find ::class notations and not strings.
Philipp Sander's user avatar
5 votes

Add an image product attribute in Magento 2 in module setup

You can add and extra attribute image to product entity using an InstallData / UpgradeData file in your module. Have a look to the following example: <?php // vendor/ModuleName/Setup/InstallData....
diazwatson's user avatar
  • 2,470
5 votes

Magento 2 : InstallData.php Does Not Seems to be Running While setup:upgrade

Try the following way: namespace VVV\Comercial\Setup; use Magento\Customer\Model\Customer; use Magento\Customer\Setup\CustomerSetup; use Magento\Framework\Setup\InstallDataInterface; use Magento\...
Sohel Rana's user avatar
  • 36.1k
5 votes
Accepted

Magento 2.2.2 Web Setup Wizard not visible in backend

this is a known issue. since early 2.0 and still not fixed in 2.3.1 https://github.com/magento/magento2/projects/14#card-3854114 https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/...
MagenX's user avatar
  • 3,813
5 votes

Magento 2.4 Best way setup with Docker environment

You can use these files to setup you docker environment easy to use visit link - https://github.com/markoshust/docker-magento I hope so it will help you.
Sanaullah Ahmad's user avatar
4 votes

There are no commands defined in the "setup:static-content" namespace

Run below command php bin/magento setup:upgrade So above command will show error and according to that you can resolve error. Another option you can check error log in var/log folder. Generally ...
ParulThakkar's user avatar
  • 1,157
3 votes

How To Download Magento 2.2.0 RC Setup using Composer?

We just published this morning with stability = rc. This command pulls down the latest RC build for me composer create-project -s rc --repository-url=https://repo.magento.com/ \ magento/project-...
Chuck's user avatar
  • 802
3 votes
Accepted

Save email template to database when install data Magento 2

You can make the InstallData.php file look like this <?php namespace [Vendor]\[Module]\Setup; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; ...
Marius's user avatar
  • 199k
3 votes

There are no commands defined in the "setup:static-content" namespace

You have to call below command in your cmd, php bin/magento setup:static-content:deploy After run above command no error are display. Remove var folder and clear cache.
Rakesh Jesadiya's user avatar
3 votes

Magento 2 on shared hosting, Vendor autoload is not found. Please run 'composer install'

You can just download composer in Magento root directory and run it like php composer.phar install or download all locally, run composer install and upload vendor directory on the server.
KAndy's user avatar
  • 20.9k
3 votes

Magento 2 add data to core_config_data

I thinking of other approach in which you should define your configurations in etc/adminhtml/system.xml and their default values in etc/config.xml Why are you trying to insert these configuration ...
Miroslav Petroff's user avatar
3 votes
Accepted

After deleting a module : "Setup version for module 'xxx' is not specified"

Mate, Hope you have deleted from app/code/ and setup_module table. But the entry still exists in the app/etc/config.php file. So, best way is to run following command again php bin/magento setup:...
Irfan Momin's user avatar
3 votes

php bin/magento setup:upgrade

Your site miss the file /var/www/vhosts/a.com/httpdocs/setup/config/application.config.php, you could copy it from original official install files. Also a possibility, the file application.config.php ...
Key Shang's user avatar
  • 3,445
3 votes
Accepted

When is the setup folder created by Magento?

This should be as part of the composer install, from the magento/magento2-base package. If you check inside {Magento_Root}/vendor/magento/magento2-base you'll see a rather familiar file structure. ...
Rhys - SproutDesk's user avatar
3 votes
Accepted

Unable to install magento 2

You should download from here. After that check your php version like this. Make sure your command line php version should same as browser php version. For checking command line php version run ...
Sohel Rana's user avatar
  • 36.1k
3 votes

How this InstallData works each line in Magento 2?

First both InstallSchema And InstallData both method are called when you install any new module Schema setup scripts change database schema, they create or change needed database tables. ...
Ronak Rathod's user avatar
  • 6,450
2 votes
Accepted

Setup resources - Run only manually

Yes it is possible. These are the two configuration settings needed within app/etc/local.xml to disable the automatic processing of setup resources: <skip_process_modules_updates>1</...
BlueC's user avatar
  • 776
2 votes

When exactly to use php bin/magento setup:upgrade

When you enable modules, change modules version you will need to run magento setup:upgrade to update the database schema. In other cases when you add new data in your class constructors, you need to ...
Ledian Hymetllari's user avatar
2 votes

show error message through plugin Magento2

If it's checkout and it is displayed in console it's possible that is ajax. Maybe try to send back html with text of messages in json an then display it using javascript file responsible for this ...
Bartosz Kubicki's user avatar
2 votes

Magento 2 on shared hosting, Vendor autoload is not found. Please run 'composer install'

You have to install it to your localhost, and then transfer files into your shared web server. That worked for me.
Oskar's user avatar
  • 151

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