Magento 2.4.1 admin page showing blank

1. Need to update code in Validator.php
2. Path: vendor\magento\framework\View\Element\Template\File
3. Replace line no 138 like below

$realPath = $this->fileDriver->getRealPath($path); replace with $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));

Run below commends.
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex

Advertisement

Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes for module Magento_Theme. And Wrong file In Gd2.php in Magento 2.4.1

Add extra condition, please edit below function on line no 90 follow this- vendor\magento\framework\Image\Adapter\Gd2.php

private function validateURLScheme(string $filename) : bool
  {
      $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
      $url = parse_url($filename);
      if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) {
          return false;
      }

      return true;
  }

Magento2 installation issue in localhost Xampp

Getting below issues while installing Magento in localhost.

  1. PHP Extension xsl.
  2. PHP Extension intl.
  3. PHP Extension soap.

Sloution:-

Go to xampp/php open php.ini file and activate below extensions.

extension=php_soap.dll

extension=php_xsl.dll

extension=php_intl.dll

 

After that restart Apache server.

 

 

Magento Files and Folders Structure

magento_directory_structure

App directory of magento

“app” directory play very important role in the magento. This directory contains allapplication development related files. app is on the root in the magento directory structure. Word app comes from word application. This directory contains following type of file:

  1. Different configuration files related to magento application like database configuration file, module configuration files etc.
  2. All module of the magento.
  3. Design and theme related files
  4. Language related files

app directory has following 4 sub directories.

  1. code
  2. design
  3. etc
  4. locale

/app/code directory: code directory is the directory for the developer. All magento code is placed in the /app/code directory. code directory has following 3 sub directories.

  1. core
  2. local
  3. community

/app/code/core directory: This directory contains all magento core modules. All magento modules clubbed in Mage namespace.
/app/code/local directory: This directory contains all locally developed module. Locally developed module means if you are customizing any core magento feature by creating any module then you can create your module in /app/code/local module.
/app/code/community directory: This directory contain module installed by magento connect.

/app/design directory: This is directory for the designer. /app/design magento directory contains all design related files of the admin and frontend interface. /app/design directory has following 3 sub directories.

  1. frontend : Contains design file related to fronted of your magento
  2. adminhtml : Contains design file related to admin interface of your magento
  3. install : Contains design file related to magento installer.

/app/etc directory: This directory primarily contains xml files. These xml files contains all configuration related information of your store. Following are some example of the configuration files of your magento store:

  1. /app/etc/local.xml file contains database server information and router information
  2. /app/etc/config.xml file contains all directory related information
  3. /app/etc/modules folder contains all module loading configuration files.

/app/locale directory: This directory contains the language string file. For example if you are running your magento store in 2 language then you need to create locale folder for every language.

So in magento directory structure app folder play very important role. If you want to learn customization of magento then you should be completely aware about the app directory structure of the magento.

Downloader directory

This directory contains files related to magento files downloading. This directory contains file which used to install the extension from magento connect.download directory is place on the root of magento directory structure.

errors directory

This directory contains different error processor and template files. Like 404 error or 503. Usually people do not touch this directory. This directory is paced on the root of magento directory structure.

includes directory

This directory contains some middle ware code file. All model files first parsed and moved into this folder and magento directly loads files from this directory. Once you made any change in your module’s model file then it first parsed and moved into the include folder. This directory is paced on the root of magento directory structure.

js directory

js  directory of the magento contains all core JavaScript library used in the magento fronted and admin area. For example extjs, prototype.js, tiny_mce etc. In next part we will explore all opensource library used by magento.

lib directory

Magento lib directory contains all php library used by magento. Some of the them are created by varien(magento company) and some other opensource library like zend framework, pear,

media directory

This directory contains all media file used in your store. For example all images uploaded in the product and category catalog. This directory also contains dynamic images used in 3rd party module. So all dynamic media files used in the magento is placed in media folder.

skin directory

skin folder is again a folder in magento directory structure in which we store media files. But in skin folder only contains media related to the design of your fronted and admin area. Skin folder contains image, css and JavaScript of all of your theme of the magento. Skin folder has further 3 main sub directory:

  1. skin/frontend: This directory contain css, js and image files of fronted magento themes
  2. skin/adminhtml: This directory contains css,js and images of admin theme of magento.
  3. skin/install: This directory contains media related to magento installer.

var directory

In magento directory structure var directory play important role. Var directory contains mainly temporary files and data. Or in other terms it contains the middleware files generated  by magento like cache, error, log, session and locks. Following are the sub-directory of the var directory:

  1. var/cache: This folder contains all magento middle ware cached data. If you will enable the caching then magento will just onetime loads some variable from XML and store in the serialized variable in a text file in cache directory. It increases the performace of you ecommerce stores.
  2. var/locks : This directory contains the table locking information.
  3. /var/session: If you will store session in the files then magento create a file in var/session directory and store all php session data in specific file of this directory.
  4. var/log: If you will enable the logging of your magento store then log will be store in this directory.

var directory is paced on the root of magento directory structure.

If you want you can slightly change the magento directory structure by using the configuration file of magento. For example you can open app/etc/config.xml and change the path of following directory:

  1. app directory.
  2. media
  3. skin
  4. var

Hope now you have clear understanding of magento directory structure.

How to Add Products in Magento

1. Go to Magento admin dashboard select “Catalog“->”Manage Products“.

2. Click on “Add Product” button to add new product.

3. Check “Create Product Settings” and select “Attribute Set” and “Product Type“.

4. After fill product information like Name, Description, SKU etc..

Issue with admin login in Magento

GO to File at this location :- app\code\core\Mage\Core\Model\Session\Abstract\Varien.php

And commenting out the following :

// session cookie params
$cookieParams = array(
    'lifetime' => $cookie->getLifetime(),
    'path'     => $cookie->getPath()//,
    //'domain'   => $cookie->getConfigDomain(),
    //'secure'   => $cookie->isSecure(),
    //'httponly' => $cookie->getHttponly()
);

//if (!$cookieParams['httponly']) {
//    unset($cookieParams['httponly']);
//    if (!$cookieParams['secure']) {
//        unset($cookieParams['secure']);
//        if (!$cookieParams['domain']) {
//            unset($cookieParams['domain']);
//        }
//    }
//}