{"id":19670225,"url":"https://github.com/tamirespatrocinio/magentotutorial","last_synced_at":"2026-05-15T10:06:36.651Z","repository":{"id":171177069,"uuid":"647527144","full_name":"tamirespatrocinio/MagentoTutorial","owner":"tamirespatrocinio","description":"Tutorial on how to install Magento in a localhost environment on the Windows operating system.","archived":false,"fork":false,"pushed_at":"2024-10-22T14:46:11.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T03:26:49.934Z","etag":null,"topics":["magento2","php","tutorial","windows"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tamirespatrocinio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-31T01:24:41.000Z","updated_at":"2024-10-22T14:48:04.000Z","dependencies_parsed_at":"2025-01-10T03:26:06.261Z","dependency_job_id":"c5e8c3e2-05b4-49c4-9d55-d6d4336c58b6","html_url":"https://github.com/tamirespatrocinio/MagentoTutorial","commit_stats":null,"previous_names":["tamirespatrocinio/magentotutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamirespatrocinio%2FMagentoTutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamirespatrocinio%2FMagentoTutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamirespatrocinio%2FMagentoTutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tamirespatrocinio%2FMagentoTutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tamirespatrocinio","download_url":"https://codeload.github.com/tamirespatrocinio/MagentoTutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240980799,"owners_count":19888343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["magento2","php","tutorial","windows"],"created_at":"2024-11-11T17:05:19.851Z","updated_at":"2026-05-15T10:06:36.603Z","avatar_url":"https://github.com/tamirespatrocinio.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Magento Installation Tutorial\n\nAfter spending several hours researching and exploring various tutorials, I finally found an effective solution. Now, I am sharing this step-by-step tutorial to help you install Magento in your development environment, considering all the necessary prerequisites. Follow the instructions carefully and enjoy a successful Magento setup.\n\n## Step 1: Environment Setup\n\n- 1.1. Make sure you have Xampp installed on your system. Download the version compatible with PHP 7.3 or higher.\n- 1.2. Install Xampp by following the instructions in the installer.\n- 1.3. After installing Xampp, open the Xampp control panel and start Apache and MySQL.\n\n## Step 2: Installing Composer\n\n- 2.1. Download and install Composer by following the instructions in the official Composer documentation.\n\n## Step 3: Installing ElasticSearch\n\n- 3.1. Download version 7.0 of Elasticsearch, as Magento does not yet support version 8.\n- 3.2. Navigate to the \"htdocs\" folder inside the Xampp directory on your system.\n- 3.3. Extract the Elasticsearch folder inside the \"htdocs\" folder.\n- 3.4. Access the \"elasticsearch \u003e bin\" folder within the Elasticsearch folder.\n- 3.5. Run the \"elasticsearch.bat\" file to start the Elasticsearch service.\n- 3.6. Confirm that the service has started by visiting http://localhost:9200 in your browser. You should see a JSON with some service data.\n\n## Step 4: Creating the Database\n\n- 4.1. Access http://localhost/phpmyadmin/ in your browser.\n- 4.2. Create a new database with a name of your choice. For example, you can use \"magento_db\".\n\n## Step 5: Enabling Extensions\n\n- 5.1. In Xampp, the php.ini file is usually located in the php folder of the installation directory. You can follow the path: C:\\xampp\\php\\php.ini.\n- 5.2. Open the php.ini file in a text editor and look for the [Extensions] section in the file to uncomment. If it doesn't exist, you can add it at the end of the file.\n```py\nextension=intl\n...\nextension=soap\nextension=sockets\nextension=sodium\n...\nextension=xsl\n```\n- 5.3. Save the changes and restart the Apache server in the Xampp control panel for the changes to take effect.\n\n## Step 6: Installing Magento\n\n- 6.1. Open a terminal or command prompt and navigate to the root folder of Xampp (usually something like \"C:\\xampp\\htdocs\" on Windows).\n- 6.2. Run the following command to download Magento using Composer:\n```py\ncomposer create-project --repository=https://repo.magento.com/ magento/project-community-edition\n```\nwith version\n```py\ncomposer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.5\n```\n- 6.3. During the installation process, you will be prompted to provide your Magento Marketplace account credentials. Make sure you have an account created and the credentials ready.\n\n## Step 7: Modifying Files\n\n\u003e [!NOTE]\n\u003e Always carefully check single and double quotes, as they can be copied incorrectly due to the platform used.\n\n7.1. Open the Magento folder in your editor of choice, navigate to the `vendor/magento/framework/Image/Adapter` folder, and open the `Gd2.php` file.\n\n7.2. Locate the `validateURLScheme` function in the file and replace all the content with the following code:\n\n```py\nprivate function validateURLScheme(string $filename) : bool\n{\n   $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];\n   $url = parse_url($filename);\n   if ($url \u0026\u0026 isset($url['scheme']) \u0026\u0026 !in_array($url['scheme'], $allowed_schemes) \u0026\u0026 !file_exists($filename)) \n    {\n       return false;\n     }\n   return true; \n}\n```    \n- 7.3. Save the Gd2.php file.\n- 7.4. Navigate to the `vendor/magento/framework/View/Element/Template/File`folder and open the `Validator.php` file.\n- 7.5. Modify the line that contains `$realPath = str_replace('\\\\', '/',$this-\u003efileDriver-\u003egetRealPath($path));` to:\n```py\n$realPath = str_replace('\\\\', '/',$this-\u003efileDriver-\u003egetRealPath($path));\n```\n- 7.6. Finally, navigate to the Magento folder and go to `vendor\\magento\\framework\\Interception`.\n- 7.7. Open the `PluginListGenerator.php` file and look for $cacheId to replace it with:\n```py\n$cacheId = implode('-', $this-\u003escopePriorityScheme) . '-' . $this-\u003ecacheId;\n```\n## Step 8: Running Magento Commands in CMD\n\n- 8.1. Open CMD in the Magento folder.\n- 8.2. This command performs the installation of Magento and configures various options, including the base URL, database, administrator information, language, currency, timezone, and Elasticsearch settings. Make sure the options in the command are correct for your environment:\n```py\nphp bin/magento setup:install --base-url=http://127.0.0.1:8082 --db-host=localhost --db-name=magento2 --db-user=root --db-password=\"\" --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=http://localhost --elasticsearch-port=9200\n ```\n- 8.3. After executing the command, wait for the installation process to complete.\n- 8.4. During the installation, you may see an automatically generated admin panel access name, like \"admin_wrr7yw.\" Note this access name, as it will be needed to access the Magento admin panel later.\n- 8.5. After completing the installation, continue by executing the following commands separately:\n\n```py\nphp bin/magento setup:di:compile\n```\n* This command compiles the Magento code and generates dependency files. It is important to run it whenever you make changes to the Magento code.\n```py\nphp bin/magento indexer:reindex\n```\n* This command reindexes Magento's indices. You need to run it whenever there are changes in Magento's data, such as products, categories, or attributes.\n```py\nphp bin/magento setup:upgrade\n```\n* This command updates the Magento database schema to reflect any changes made to the modules. It is important to run it whenever you update or install new modules.\n```py\nphp bin/magento setup:static-content:deploy -f en_US en_GB\n```\n* This command deploys Magento's static files for the languages en_US (U.S. English) and en_GB (British English). Make sure to replace these languages with those you are using in your project.\n```py\nphp bin/magento deploy:mode:set developer\n```\n* This command sets Magento's deployment mode to \"developer.\" In developer mode, Magento displays detailed error messages and automatically regenerates static files. It is recommended for development environments.\n```py\nphp bin/magento cache:clean\n```\n* This command clears Magento's cache, removing cached files and cached data. It is useful to run it after making changes to the code or Magento configuration.\n```py\nphp bin/magento cache:flush\n```\n* This command completely flushes Magento's cache, removing all cached files and data. Use with caution, as this can take some time to regenerate the cache when Magento is accessed again.\n```py\nphp bin/magento module:disable Magento_Csp\n```\n* This command disables the Magento_Csp module. You can replace \"Magento_Csp\" with the name of the module you want to disable. Remember that disabling a module can affect Magento's functionality, so do this only if necessary.\n```py\nphp bin/magento module:disable Magento_TwoFactorAuth\n```\n* This command disables the Magento_TwoFactorAuth module, which is responsible for two-factor authentication in Magento. If you do not need this additional security feature, you can disable it using this command.\n\n## Step 9: Finalization\n\nTo proceed, return to phpMyAdmin and follow these steps:\n\n- 9.1. Open phpMyAdmin and select the database.\n- 9.2. Go to the \"SQL\" section at the top of the page.\n- 9.3. In the provided text area, paste the following query:\n```py\nINSERT INTO `core_config_data`(`path`, `value`) VALUES ('dev/static/sign', 0) ON DUPLICATE KEY UPDATE `value`=0\n```\n- 9.4. To execute the query and apply the changes, click the \"Execute\" button in phpMyAdmin.\n- 9.5. Then, run the following command to clean the cache exclusively for the configurations:\n```py\nphp bin/magento cache:clean config\n```\nIsso garantirá que as alterações de configuração sejam atualizadas corretamente.\n\nPor fim, para iniciar a aplicação Magento localmente, use o seguinte comando:\n```py\nphp -S 127.0.0.1:8082 -t ./pub/ ./phpserver/router.php\n```\nAfter completing the command, you should see the Magento dashboard. \n\n![magento](https://github.com/tamirespatrocinio/MagentoTutorial/assets/73259410/a89e62ae-3968-467f-b5e6-a41c6a525d7e)\n\nTo access the admin panel, simply open the URL in your browser:\n`http://127.0.0.1:8082/admin_wrr7yw/`.\nMake sure to replace \"admin_wrr7yw\" with the correct URL for your admin panel.\n\n\n\u003e [!CAUTION]\nIf you encounter a bug similar to the one shown in the image, follow the commands below to resolve it and run the application again:\n\n![error](https://github.com/tamirespatrocinio/MagentoTutorial/assets/73259410/8a3be36f-127d-46d1-97ab-3ed909519c2d)\n```py\nphp bin/magento setup:upgrade\n```\n```py\nphp bin/magento setup:static-content:deploy -f \n```\n* This command is used to deploy Magento's static files. The -f option indicates that you want to force the deployment, replacing existing static files if there are any. By executing this command, Magento will compile and copy the relevant static files for the configured languages in your project. This includes CSS, JavaScript, images, and other static resources necessary for the proper functioning of the online store.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamirespatrocinio%2Fmagentotutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftamirespatrocinio%2Fmagentotutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamirespatrocinio%2Fmagentotutorial/lists"}