Call to undefined function simplexml_load_string() - php

Call to undefined function simplexml_load_string()
I am getting this error on all the sites located on our server. Everything was working correctly until today and all of sudden this error poped up.
I have checked Simplexml and it is already installed on the server. Here is the error:
Fatal error: Call to undefined function simplexml_load_string() in
.../lib/Varien/Simplexml/Config.php on line 510

Had the same problem today. I tried to check whether extension is loaded and I was getting true (from command line) Then I found that I was using multiple php versions and the site in question was using php5.4 which for some reason was failing for simplexml
Since I am in a cPanel/WHM environment I ran
yum install ea-php54-php-simplexml
which fixed the issue. This is for EasyApache4. Perhaps you can just update simplexml sepending on your flavour of linux.

Installing latest extension resolved the issue.
yum install ea-php56-php-simplexml

Related

Call to undefined function apcu_add()

I'm currently working on an api which has been developed using Lumen 5.4. I'm trying to run this on my local XAMPP for Linux 7.4.3. But I keep getting the following error,
lumen.ERROR:
Symfony\Component\Debug\Exception\FatalThrowableError:
Call to undefined function xxx\Prometheus\Storage\apcu_add() in
/opt/lampp/htdocs/xxx-api/vendor/xxx/php-prometheus-exporter/src/Storage/APCU.php:78
Current PHP version is 7.4.3. I have installed apcu along with apcu_bc and added the following to php.ini as well,
extension=apc.so
apc.enabled="1"
but I'm not seeing any apc related info in phpinfo.php page.
Any help is appreciated.

Fatal error: Call to undefined method PEAR::XML_Parser() in /[DIR]/php5.6.10/lib/php/PEAR.php on line 219

After doing a lot of Google search and also going trough SO questions.
I did not find solution to this problem.
I have installed MAMP with multiple versions.
Currently working on PHP-5.6.10.
I am facing this issue:
Fatal error: Call to undefined method PEAR::XML_Parser() in /[DIR]/php5.6.10/lib/php/PEAR.php on line 219
Can anybody please look into it?
I got it solved.
How?
It was a version problem.
Go to http://pear.php.net/package/XML_Parser/download
Click on Download, you will get the appropriate package name.
Install package with that version.
EDIT:
Uninstalled and reinstalled the module
XML_Parser
Commands:
pear uninstall XML_Parser-1.3.7
pear install XML_Parser-1.3.1

Class 'DateTimeImmutable' not found

I've just run an update for my CakePHP version (3.1.7). And now I'm unable to run my app, with a fatal error :
Fatal error: Class 'DateTimeImmutable' not found in /opt/lampp/htdocs/my-app/vendor/cakephp/chronos/src/Chronos.php on line 50
I found this issue on Github, where I noticed that
DateTimeImmutable was not present in 5.4
So I install PHP5.6.20 on my PC, but after restarting Xampp, I still get the same error. How can I fix this ?
PHP's installation on the PC is not related to Xampp. So installing PHP doesn't solve the problem. But installing a new version of Xampp with PHP 5.6.
It's a PHP Version Problem make sure You're using PHP > 5.5v

ImageMagick on MAMP

I am trying to install ImageMagick on my Mac using MAMP using homebrew.
In the terminal I am not getting the following message:
Warning: php53-imagick-3.1.0RC2 already installed
When trying to run the install script, which was apparently successful, however I still receive the following error when trying to use ImageMagick from PHP:
Fatal error: Class 'Imagick' not found in....
I'm amazed at how difficult this has been, if anyone could help me out it would be greatly appreciated.

PHP 5.3.20: undefined function hash()

I'm trying to install Magento on FreeBSD with PHP 5.3.20, but the install script fails with
Fatal error: Call to undefined function hash() in /var/www/.../magento/lib/Zend/Cache/Backend/File.php on line 894
As it's cleared in another StackOverflow question it requires PHP 5.1.2, so that's a different problem. I installed the php5-mhash extension from ports and added mhash.so and hash.so to the extensions.ini. Also, there is no --disable-hash in the configure command. And it's the same in CLI too.
Probably because open_basedir? Any ideas?
Try installing it from security and see if this will work for you.
cd /usr/ports/security/php5-hash
make install clean

Categories