pestle
pestle copied to clipboard
Detect Lack of XML Module and Warn User
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()
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?
Normally php 7.2 installment on Ubuntu 18.04, although my magento installment is on docker, could this be an issue?
@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.
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.
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
Thank you very much @astorm, you were totally correct with the xml missing modules.
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.