How to run Magento 2 from an external script
This post describes how to run Magento 2 code in an external file or script. The external file can be inside the Magento root folder or subfolder. This example considers that the file is present in the Magento 2 root folder. Let us name the file as test-script.php. So, we want to execute some code…