Categories
Magento 2

Exception: Invalid template file: require_js.phtml in module: ‘Magento_Backend’ block’s name: ‘require.js’

To fix blank admin page on Magento 2.3 in Windows-10. This is the error what you will encounter when installing Magento 2.3 in Windows 10!

This error for the invalid template file is the difference between the use of “/” and “\” in the path. Windows uses “/” while Magento uses “\”.

The exception appear like this:

1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: ‘E:/xampp/htdocs/extendfeature/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml’ in module: ‘Magento_Backend’ block’s name: ‘require.js’

Open file vendor\magento\framework\View\Element\Template\File\Validator.php line no 138. Of find isPathInDirectories function in line 133

And change line 138 from

To

After make change find isPathInDirectories function like below code.

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Please LIKE and SHARE

Categories
Magento 2

Magento 2 Installation at 51% Error: (Wrong file in Gd2.php:64) Module ‘Magento_Theme’

I am having an issue during installing Magento 2 in localhost window10. I have updated my file like below and I can install in localhost. I am trying to solve by change on my php.ini

Also No UAC activate on WINDOWS 10 and Antivirus disabled. I have fetch the same error.

[ERROR]

InvalidArgumentException: Wrong file in E:\xampp\htdocs\extendfeature\vendor\magento\framework\Image\Adapter\Gd2.php:64 Stack trace: #0 E:\xampp\htdocs\extendfeature\vendor\magento\framework\Image.php(55): Magento\Framework\Image\Adapter\Gd2->open(‘E:/xampp/htdocs…’) #1 E:\xampp\htdocs\extendfeature\vendor\magento\framework\Image.php(36): Magento\Framework\Image->open() #2 E:\xampp\htdocs\extendfeature\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(121): Magento\Framework\Image->__construct(Object(Magento\Framework\Image\Adapter\Gd2), ‘E:/xampp/htdocs…’) #3 E:\xampp\htdocs\extendfeature\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject(‘Magento\Framewo…’, Array) #4 E:\xampp\htdocs\extendfeature\vendor\magento\framework\ObjectManager\ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create(‘Magento\Framewo…’, Array) #5 E:\xampp\htdocs\extendfeature\vendor\magento\framework\Image\Factory.php(47): Magento\Framework\ObjectManager\ObjectManager->create(‘Magento\Framewo…’, Array) #6 E:\xampp\htdocs\extendfeature\vendor\magento\framework\View\Design\Theme\Image.php(127): Magento\Framework\Image\Factory->create(‘E:/xampp/htdocs…’) #7 E:\xampp\htdocs\extendfeature\vendor\magento\module-theme\Model\Theme\Registration.php(135): Magento\Framework\View\Design\Theme\Image->createPreviewImage(‘E:/xampp/htdocs…’) #8 E:\xampp\htdocs\extendfeature\vendor\magento\module-theme\Model\Theme\Registration.php(114): Magento\Theme\Model\Theme\Registration->_savePreviewImage(Object(Magento\Theme\Model\Theme\Data)) #9 E:\xampp\htdocs\extendfeature\vendor\magento\module-theme\Model\Theme\Registration.php(73): Magento\Theme\Model\Theme\Registration->_registerThemeRecursively(Object(Magento\Theme\Model\Theme\Data)) #10 E:\xampp\htdocs\extendfeature\vendor\magento\module-theme\Setup\Patch\Data\RegisterThemes.php(47): Magento\Theme\Model\Theme\Registration->register() #11 E:\xampp\htdocs\extendfeature\vendor\magento\framework\Setup\Patch\PatchApplier.php(162): Magento\Theme\Setup\Patch\Data\RegisterThemes->apply() #12 E:\xampp\htdocs\extendfeature\setup\src\Magento\Setup\Model\Installer.php(1023): Magento\Framework\Setup\Patch\PatchApplier->applyDataPatch(‘Magento_Theme’) #13 E:\xampp\htdocs\extendfeature\setup\src\Magento\Setup\Model\Installer.php(890): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\DataSetup), ‘data’, Array) #14 [internal function]: Magento\Setup\Model\Installer->installDataFixtures(Array) #15 E:\xampp\htdocs\extendfeature\setup\src\Magento\Setup\Model\Installer.php(371): call_user_func_array(Array, Array) #16 E:\xampp\htdocs\extendfeature\setup\src\Magento\Setup\Controller\Install.php(109): Magento\Setup\Model\Installer->install(Array) #17 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-mvc\src\Controller\AbstractActionController.php(83): Magento\Setup\Controller\Install->startAction() #18 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-eventmanager\src\EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent)) #19 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-eventmanager\src\EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #20 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-mvc\src\Controller\AbstractController.php(115): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #21 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-mvc\src\DispatchListener.php(117): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response)) #22 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-eventmanager\src\EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent)) #23 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-eventmanager\src\EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #24 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-mvc\src\Application.php(339): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #25 E:\xampp\htdocs\extendfeature\setup\index.php(39): Laminas\Mvc\Application->run() #26 {main} Next Magento\Framework\Setup\Exception: Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes for module Magento_Theme. Original exception message: Wrong file in E:\xampp\htdocs\extendfeature\vendor\magento\framework\Setup\Patch\PatchApplier.php:170 Stack trace: #0 E:\xampp\htdocs\extendfeature\setup\src\Magento\Setup\Model\Installer.php(1023): Magento\Framework\Setup\Patch\PatchApplier->applyDataPatch(‘Magento_Theme’) #1 E:\xampp\htdocs\extendfeature\setup\src\Magento\Setup\Model\Installer.php(890): Magento\Setup\Model\Installer->handleDBSchemaData(Object(Magento\Setup\Module\DataSetup), ‘data’, Array) #2 [internal function]: Magento\Setup\Model\Installer->installDataFixtures(Array) #3 E:\xampp\htdocs\extendfeature\setup\src\Magento\Setup\Model\Installer.php(371): call_user_func_array(Array, Array) #4 E:\xampp\htdocs\extendfeature\setup\src\Magento\Setup\Controller\Install.php(109): Magento\Setup\Model\Installer->install(Array) #5 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-mvc\src\Controller\AbstractActionController.php(83): Magento\Setup\Controller\Install->startAction() #6 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-eventmanager\src\EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent)) #7 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-eventmanager\src\EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #8 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-mvc\src\Controller\AbstractController.php(115): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #9 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-mvc\src\DispatchListener.php(117): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response)) #10 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-eventmanager\src\EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent)) #11 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-eventmanager\src\EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #12 E:\xampp\htdocs\extendfeature\vendor\laminas\laminas-mvc\src\Application.php(339): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #13 E:\xampp\htdocs\extendfeature\setup\index.php(39): Laminas\Mvc\Application->run() #14 {main}

Solutions:

Finally Installation is complete 100% after done following changes:

Find validateURLScheme function in vendor\magento\framework\Image\Adapter\Gd2.php file. at line 96. Replace function with this: !file_exists($filename)

Please find and change validateURLScheme function like below code.

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Please LIKE and SHARE

Categories
Magento 2

Install Magento 2 Using Composer in localhost XAMPP server

Install Magento 2 Using Composer in localhost. In this article I will guide to you how to install composer and how to install Magento 2 with Composer in localhost XAMPP server or web server.

At first we want to know about Magento 2 System Requirements? Here is the full checklist.

Step 1: Install Composer

After setup XAMPP server go htdocs directory E:\xampp\htdocs and Download and Run the Composer Windows Installer from here:
Download Composer

Check the installation using composer -V
Output: Composer version 1.10.1 2020-03-13 20:34:27

If you want to Composer setup on web server please please login into SSH terminal and run following commands to check and install composer. If nothing displays or you face any errors, please install Composer Download Composer

Step 2: Setup Virtual Hosts

Setup Virtual Hosts and create a url for run magento project. Open E:\xampp\apache\conf\extra\httpd-vhosts.conf add following lines for setup Virtual Hosts.

Step 3: Setup a URL

Setup URL on windows host file. Open C:\Windows\System32\drivers\etc\hosts add following lines for browse site via browser.

Step 4: Download Magento 2

Go to XAMPP server htdocs E:\xampp\htdocs directory via SSH terminal and Run the following command in the htdocs directory.

Note: I have define “magento23” is project install directory in Setup Virtual Hosts section.

Step 5: Create The Database

Create an empty database to work with MySQL in case you have already created so ignore database creating step and next step.

Step 6: Install Magento 2

Run the following lines in Command Line to install your Magento 2

Magento 2 console command setup:install install Magento 2 via Command Line. If this command run without error you can see like following image:

Install Magento 2 by command line

Please check your Magento 2 project admin amd database information in app\etc\env.php file backend and db section.

Now Magento 2 setup is done in XAMPP windows server. Now write http://magento2demo.com/ in your web browser and enjoy magento 2 project.

Exception: in module: ‘Magento_Backend’ block’s name: ‘require.js’

If we gitting Exception: Invalid template file: vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml in module: ‘Magento_Backend’ block’s name: ‘require.js’

Open file vendor\magento\framework\View\Element\Template\File\Validator.php line no 138.

change line 138 from

to

See more derails Here…

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Please LIKE and SHARE

Categories
Laravel

Laravel install in localhost XAMPP server

Laravel install in localhost XAMPP server, please execute following 7 steps.

1. Download XAMPP for Windows, Linux or OSX Installer from here:
Download XAMPP and make ready your local web server.

2. Go to localhost web root directory E:\xampp\htdocs
Create a new folder for your project like “laraveldemo”

3. Run Command Prompt for Windows
Go to project root directory E:\xampp\htdocs

4. Download and run the Composer Windows Installer from here:
Download Composer

Download Composer
Download Composer

5. Check the installation using composer -V
Output: Composer version 1.10.1 2020-03-13 20:34:27

6. If Composer is works fine, than go to install laravel using the following command.
composer create-project laravel/laravel laraveldemo
OR
composer create-project laravel/laravel laraveldemo –prefer-dist “laraveldemo” is your project directory.

laravel composer create-project

7. After complete install and create laravel project we need to create Local Development Server by artisan command. Go to project root directory E:\xampp\htdocs\laraveldemo and run artisan command php artisan serve

php artisan serve command

Browser your laravel project using http://127.0.0.1:8000 url on browser and enjoy!

Laravel demo project

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with me. Please LIKE and SHARE