pestle icon indicating copy to clipboard operation
pestle copied to clipboard

Detect Lack of XML Module and Warn User

Open danyvega1990 opened this issue 5 years ago • 7 comments

Pestle list comands, gives help, but when I try to create a new magento module it shows this PHP Fatal error: Uncaught Error: Call to undefined function Pulsestorm\Magento2\Cli\Generate\Module\simplexml_load_string()

danyvega1990 avatar Jul 17 '19 15:07 danyvega1990

Thanks for giving pestle a try @danyvega1990. It looks like we're trying to call the built-in simplexml_load_string function but can't. My best guess is your version of PHP was built/compiled without this module.

Do you know where you got your version of PHP from?

astorm avatar Jul 17 '19 15:07 astorm

Normally php 7.2 installment on Ubuntu 18.04, although my magento installment is on docker, could this be an issue?

danyvega1990 avatar Jul 17 '19 15:07 danyvega1990

@danyvega1990 I'm not familiar with the standard Ubuntu provided PHP on 18.04 -- however, my guess is when you install PHP there you get a very "bare" PHP with no module, and then just add the ones you want. Look for a package with both PHP and XML in the name -- similar to what's going on in this issue: https://github.com/astorm/pestle/issues/463 Let us know if that does or doesn't help.

astorm avatar Jul 18 '19 00:07 astorm

although my magento installment is on docker

Is where you're running pestle from that matters. Pestle is a phar, which is a PHP archive. It needs a system PHP to run. Whereever you run the phar, that's where you'll need to a version of PHP with the XML module installed.

astorm avatar Jul 18 '19 00:07 astorm

Also, try the following command -- this will tell us if we're right about your version of PHP missing the XML module.

$ php --info | grep XML

astorm avatar Jul 18 '19 00:07 astorm

Thank you very much @astorm, you were totally correct with the xml missing modules.

danyvega1990 avatar Jul 19 '19 13:07 danyvega1990

Thank you @danyvega1990 -- if you don't mind I'm going to keep this issue open as a task to have better detection of this condition in pestle and give folks a better error experience.

astorm avatar Jul 20 '19 23:07 astorm