Hey guys I have created a php file in the public_html folder and writed the following code:

<?php system('php bin\magento module:enable Wisedat_PDFInvoiceFile');
system('php bin/magento setup:upgrade'); // You can change command as
you want.

And when I go to run the command in http://mydomain/command.php

the only thing that show´s up is a blank page !!

Can someone help?


  • Why you want this? – Sukumar Gorai Sep 13 '18 at 14:51
  • what the output of this file – Prashant Valanda Sep 13 '18 at 14:52
  • please change backslash in first command to same as second command in bin/magento – Piyush Sep 13 '18 at 14:53
  • @PrashantValanda i think the output is a module instalation – Pseudog Sep 13 '18 at 14:54
  • @Piyush done it still nothing – Pseudog Sep 13 '18 at 14:55

Your code php bin\magento module:enable Wisedat_PDFInvoiceFile is wrong

It should be

php bin/magento module:enable Wisedat_PDFInvoiceFile

You have to run static content deploy and di compile commands after run setup upgrade

Also, you can use php shell_exce as in below code

shell_exec('php -d memory_limit=5G bin/magento module:enable Wisedat_PDFInvoiceFile');
shell_exec('php -d memory_limit=5G bin/magento setup:upgrade');
shell_exec('php -d memory_limit=5G bin/magento setup:di:compile');
shell_exec('php -d memory_limit=5G bin/magento setup:static-content:deploy -f');


But I am not sure that how much this script will work as you might get the error of execution time and memory limit during the running of this script from browser.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.