2

I have some trouble receiving order emails so i debuged a bit.

  • Installed AOE Scheduler

Found some issues with the cron so i checked this. Now its running but keeps sending me the following errors:

When trying to run schedular_cron.sh:

PHP Fatal error: Call to undefined function simplexml_load_string() in /path/to/magento/lib/Varien/Simplexml/Config.php on line 510

When trying to run cron.sh (Mage default):

PHP Fatal error: Call to undefined function simplexml_load_file() in /path/to/magento/app/Mage.php on line 767

Both *.sh files are executable and have the right owner.

Based on my phpinfo() SimpleXML is enabled. Also, if (extension_loaded('simplexml')) tells me its loaded.

3
  • What is your PHP version ? – Pilou Nov 23 '15 at 16:42
  • My PHP version is 5.4.45 – RoRo Nov 23 '15 at 16:45
  • did you found solution ? – Baby in Magento Oct 31 '17 at 6:48
3

This errors means you do not have the simpleXML library loaded with PHP.

You should print your phpinfo() in Command Line mode and check the presence of the simplexml library.

Check then how to install the simplexml library on your OS.

6
  • 1
    In my phpinfo it looks enabled: Simplexml support enabled Revision $Id: (number) $ Schema support enabled – RoRo Nov 23 '15 at 16:20
  • Did you check the Apache or the CLI ? Your cron run in CLI i guess. – Pilou Nov 23 '15 at 16:32
  • Yes its running in CLI, what do you mean by this question? – RoRo Nov 23 '15 at 16:33
  • just to be sure you've checked your config using the CLI, not in a browser. Apache and CLI can have different settings. – Pilou Nov 23 '15 at 16:38
  • 1
    Ok, so am i checking it the right way or? – RoRo Nov 23 '15 at 16:39
3

The error output is common when php-xml extension is not installed (or unavailable) for the PHP CLI.

To fix it, install php-xml (for your version of PHP) using:

For PHP 5.4

sudo apt-get install php5-xml

For PHP 5.6

sudo apt-get install php5.6-xml

Then restart php5-fpm

sudo service php5-fpm restart

After installation of php-xml, if you encounters such as:

Zend_Db_Adapter_Exception' with message 'pdo_mysql extension is not installed' in /var/www/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php

Then, install pdo-mysql and php5-gd For PHP 5.4

sudo apt-get install php5-gd php5-mysql

For PHP 5.6

sudo apt-get install php5.6-gd php5.6-mysql

Then restart php5-fpm

sudo service php5-fpm restart
2

On the command line, do:

$ php -m    # shows modules enabled for CLI
$ php --ini # shows configs being used

Run phpinfo() in the browser and decided what you need to change based on the settings for your webserver.

1
  • 1
    SimpleXML is enabled in CLI. What should i look for to change since the error is about SimpleXML ? – RoRo Nov 24 '15 at 23:42
0

Sometimes You must restart (if You have in Your PHP instalation) an FPM, in my situation: service php7.1-fpm restart Without this restart, I have a "Call to undefined function simplexml_load_file" although php7.1-xml was correctly installed and enabled (... from phpinfo() )

-1

Try to include the module path:

php -c /etc/php.d/ 

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.