I have created a php file on root folder of magento in Magento 2 and hit a controller on that file. That process is done and i have tested it it running on terminal.

How would i run that script from magento backend on click a button is it possible.

Any help is appreciated.

  • Yes, you can do this but you can change your way to do this. – Dhiren Vasoya Sep 3 '20 at 14:20
  • How to proceed will you please tell me @DhirenVasoya – Prits Sep 3 '20 at 14:21
  • Why you not put that controller code into your button action? – Dhiren Vasoya Sep 3 '20 at 14:29
  • In that controller code i have create product from txt file so it is very large file so it would be stuck after some time thats why i have to do this with php script.@DhirenVasoya – Prits Sep 3 '20 at 14:33
  • @Prits Create a queue type cron job that runs every minute and runs the task in the background, but only if the controller has added it to the "queue" – joeybab3 Sep 3 '20 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.