Home » Magento, Magento 215 August 2016

Magento 2: Run code in external file/script

This article shows how to run Magento 2 code in an external file/script. The external file can be inside the Magento root folder or outside of it.

This example considers that the file is present in the Magento 2 root folder. Let us name the file as abc.php. So, we want to execute some code when we open http://example.com/abc.php.

Here is the code to be written in the external file.

A good discussion is going on here regarding this topic.

Hope this helps. Thanks.

Magento 2

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed