Magento2 backend fatal error after backup recovery - php

After a backup recovery on my magento2 website I get this error:
Backend fatal error: PHP Fatal error: Uncaught Error: Class
'DOMDocument' not found in
/home/arredeom/public_html/vendor/magento/framework/Config/Dom.php:364\nStack
trace:\n#0
/home/arredeom/public_html/vendor/magento/framework/Config/Dom.php(109):
Magento\Framework\Config\Dom->_initDom('__construct('_createConfigMerger('Magento\\Framewo...',
'_readFiles(Object(Magento\Framework\Config\FileIterator))\n#4
/home/arredeom/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(269):
Magento\Framework\Config in
/home/arredeom/public_html/vendor/magento/framework/Config/Dom.php on
line 364\n
I've checked on cpanel config and on PHP Selector | extensions it says: Current PHP version: 7.0 and Dom is enabled (flag is on)
is there any way to fix it? thanks

PHP told you
Class 'DOMDocument' not found ...
The DomDocument class is a fundamental part of PHP's XML handling. If the DomDocument class is not present, that means whomever updated your backend server didn't include this fundamental part of PHP. This is common in some Linux package management features that slice up core PHP functionality so users can install only what they need.
The way to fix this is to install PHP's XML/DOM functionality. The way you do that will depend on which linux distribution you're using.

You need php-xml :
sudo apt-get install php-xml

Related

Fatal error: Uncaught Error: Class "Phalcon\Config" not found in Phalcon Php application

I installed Phalcon PHP version 5.0.0beta3 in my Ubuntu, because it's compatible with PHP 8.0, but when I run my application some Phalcon classes are not found, I already installed the psr module using the following command:
sudo apt install php8.0-psr
and I have installed phalcon.so by direct download from phalcon php github releases, so when I access my phpinfo() I can see it there:
evidence of phalcon.so instalation
any idea what's going on?
Phalcon 5 has a number of backwards incompatible changes. Most prominent is all the classes in the base Phalcon namespace were moved to more accurate locations.
Phalcon\Config -> Phalcon\Config\Config
Phalcon\Di -> Phalcon\Di\Di
Etc
Check the release notes at https://github.com/phalcon/cphalcon/blob/master/CHANGELOG-5.0.md for specific changes.

Installing PECL in Cpanel (Fatal Error Class 'HttpRequest' not found )

I need to call an API using PECL from my Server. I installed PEAR and PECL from the PHP PEAR Packages in Cpanel. .I attached the screenshot. But when I run my code $request = new HttpRequest(); it returns an error Fatal error: Class 'HttpRequest' not found in /home/wonr/public_html/sms_api.php on line 3
It is shared hosting.Is this causing because of the path error? Or do I need to do any additional setup on the Server?
I cannot find additional information on this.
Thank you.

mcrypt and PHPUnit

I am using PHPUnit to test a project where mcrypt is heavily used. I have installed phpunit using this SO answer.
Whenever I try and run phpunit, I get the following error:
Fatal error: Call to undefined function mcrypt_create_iv() in
/files/file/using/mcrypt/thing.php on line 20
How can I fix this error? Do I have to install mcrpyt especially for PHPUnit?
You can either install MCrypt (which you should do anyway) or mark that specific test as one requiring MCrypt. The latter will cause the test to be skipped if you don't have MCrypt installed.

install SOAP Extension in apache from Remote System

I was trying to use soap services but i have been facing following error
Fatal error: Class "SoapClient" not found
I have determined one part that was the easy one that soap extension is not installed. So now i want to install it but i can only access to the server through terminal and root user.
I cannot find any tutorial which can guide me to install soap extension to remote server. Also I am not sure what risks are involved as i am very beginner to it. So any kind of help will be much appreciated.
my php version is 5.1.6, apache version is 2.2.3 and Server OS is CentOS release 5.2
Regards
http://www.wallpaperama.com/forums/how-to-install-php-soap-extension-in-apache-linux-php-server-remove-t1756.html
The above url shows you how to install soap extension for php and Fatal error: Class 'SoapClient' not found this link would show you do you have it installed or not or it is enabled or not.
Thanks & Regards,
Alok Thaker

Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine

I'm attempting to get the link shortening PHP scripts YOURLS working on my basic web server running Lubuntu 12.04.
I have a MySQL database created and PHP5 installed. When I attempt to access the administration interface for YOURLS in a browser, I am presented with the following message:
Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine
I'm very new to MySQL and PHP, so I don't know how to approach this problem. Could you point me in the right direction on this?
(For a quick guide to setting up YOURLS, you can see this video to get the general idea.)
You need to ensure that the MySQL extension is loaded into PHP.ini, and has been compiled into PHP as well.
Install mysql-devel and php-mysqli packages
yum install mysql-devel php-mysqli
Names can change a bit as Ernest show's in his answer.
If you have installed your php server and mysql through yum, try to use yum to search for the relevant package.
For example, if you used "yum install php55", try "yum search php55", then look for something like "php55-mysqld". If found, install it "yum install php-mysqld". That will install the required module for PHP to interact with your mysql.
Installing all php packages and its dependencies worked for me.
yum install php-*
finnaly i Found the solution
just change this line > class ezSQL_mysql extends ezSQLcore in ez_sql_mysql.php
to class ezSQL_mysqlx extends ezSQLcore
:)

Categories