magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

PHP Fatal error: Uncaught Error: Class "DOMDocument" not found in /home/bumbinguglies/public_html/vendor/magento/framework/Config/Dom.php:449Stack trac #37614

Closed georgittanchev closed 1 year ago

georgittanchev commented 1 year ago

Preconditions and environment

Steps to reproduce

Install Magento via the command: composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.5 magento2

Then:

bin/magento setup:install \ --base-url=http://bumbinguglies.com \ --db-host=localhost \ --db-name=bumbinguglies_magento \ --db-user=bumbinguglies_magento \ --db-password=aoNACCk2W1qQh9 \ --admin-firstname=admin \ --admin-lastname=admin \ --admin-email=admin@admin.com \ --admin-user=admin \ --admin-password=admin123 \ --language=en_US \ --currency=USD \ --timezone=America/Chicago \ --use-rewrites=1

Then the website doesn't load only 500 error is received and the error log shows

[bumbinguglies@workhard public_html]$ tail -f error_log

1 /home/bumbinguglies/public_html/vendor/magento/framework/ObjectManager/Config/Reader/Dom.php(70): Magento\Framework\Config\Dom->__construct()

2 /home/bumbinguglies/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(151): Magento\Framework\ObjectManager\Config\Reader\Dom->_createConfigMerger()

3 /home/bumbinguglies/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(132): Magento\Framework\Config\Reader\Filesystem->_readFiles()

4 /home/bumbinguglies/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(279): Magento\Framework\Config\Reader\Filesystem->read()

5 /home/bumbinguglies/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(140): Magento\Framework\App\ObjectManagerFactory->_loadPrimaryConfig()

6 /home/bumbinguglies/public_html/vendor/magento/framework/App/Bootstrap.php(211): Magento\Framework\App\ObjectManagerFactory->create()

7 /home/bumbinguglies/public_html/vendor/magento/framework/App/Bootstrap.php(126): Magento\Framework\App\Bootstrap->__construct()

8 /home/bumbinguglies/public_html/index.php(36): Magento\Framework\App\Bootstrap::create()

9 {main}

thrown in /home/bumbinguglies/public_html/vendor/magento/framework/Config/Dom.php on line 449

Expected result

To see the luma theme after the installation instead of a 500 error.

Actual result

500 error:

-> https://prnt.sc/xNGesINRzwbW

PHP fatal error in error log

Additional information

I am receiving the same error on 2.3.5 installed via Magento-CLI, composer install works fine, however, the error log provides the following output:

[14-Jun-2023 18:17:06 UTC] PHP Fatal error: Uncaught Error: Class "DOMDocument" not found in /home/bumbinguglies/public_html/vendor/magento/framework/Config/Dom.php:449Stack trace:

0 /home/bumbinguglies/public_html/vendor/magento/framework/Config/Dom.php(116): Magento\Framework\Config\Dom->_initDom()https://github.com/magento/magento2/issues/1 /home/bumbinguglies/public_html/vendor/magento/framework/ObjectManager/Config/Reader/Dom.php(70): Magento\Framework\Config\Dom->__construct()https://github.com/magento/magento2/pull/2 /home/bumbinguglies/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(151): Magento\Framework\ObjectManager\Config\Reader\Dom->_createConfigMerger()https://github.com/magento/magento2/pull/3 /home/bumbinguglies/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(132): Magento\Framework\Config\Reader\Filesystem->_readFiles()https://github.com/magento/magento2/issues/4 /home/bumbinguglies/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(279): Magento\Framework\Config\Reader\Filesystem->read()https://github.com/magento/magento2/issues/5 /home/bumbinguglies/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(140): Magento\Framework\App\ObjectManagerFactory->_loadPrimaryConfig()https://github.com/magento/magento2/issues/6 /home/bumbinguglies/public_html/vendor/magento/framework/App/Bootstrap.php(211): Magento\Framework\App\ObjectManagerFactory->create()

https://github.com/magento/magento2/issues/7 /home/bumbinguglies/public_html/vendor/magento/framework/App/Bootstrap.php(126): Magento\Framework\App\Bootstrap->__construct()https://github.com/magento/magento2/issues/8 /home/bumbinguglies/public_html/index.php(36): Magento\Framework\App\Bootstrap::create() https://github.com/magento/magento2/pull/9 {main} thrown in /home/bumbinguglies/public_html/vendor/magento/framework/Config/Dom.php on line 449

PHP extensions enabled: [PHP Modules] bcmath clos_ssa Core ctype date dom filter ftp hash json libxml mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix readline Reflection session SimpleXML SPL sqlite3 standard tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zlib

Magento is installed with the following command: composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.5 magento2

It looks like the dom extension is completely installed on PHP 7.1, yet Magento 2.3.5 is looking for it for some reason as it is not there, what may the reason be for that?

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @georgittanchev. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 1 year ago

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


engcom-Dash commented 1 year ago

Hi @georgittanchev ,

Thanks for collaboration and contribution !

verified the issue 2.4-develop instance and the issue is not reproducible.

Kindly refer the below screenshots:

Screenshot 2023-06-15 at 5 36 37 PM

Steps to reproduce: I.install magento install using composer command 2.Verify Front-end Luma theme working or not

We are getting luma theme after composer installation and issue is not reproducible.Kindly recheck the behaviour in 2.4-develop instance as well as kindly update your magento 2.3.5 with latest version and recheck the behaviour.

Let us know if are missing anything!

Thanks!

magento-deployment-service[bot] commented 1 year ago

Hi @georgittanchev. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @georgittanchev, here is your Magento Instance: https://af759bd424aeff5ab3fa72d4228440a2.instances-prod.magento-community.engineering Admin access: https://af759bd424aeff5ab3fa72d4228440a2.instances-prod.magento-community.engineering/admin_d0d2 Login: ec53e00c Password: c702747d3afc

georgittanchev commented 1 year ago

The issue at hand pertains specifically to Magento 2.3.5, which is being run in conjunction with CloudLinux and WHM. I am uncertain as to where and why you have conducted your tests using version 2.4, considering that the problem arises from version 2.3.5. I am inclined to carry out an upgrade test for Magento via the terminal. However, I am impeded by the fact that I am unable to install it initially.

I would appreciate it if you could clarify on which operating system you are installing Magento 2.4 and delineate the exact commands you are employing. As it stands, there are servers where installation proceeds without a hitch. On this particular server, though, a particular issue arises. Despite the dom extension being enabled, Magento, for some reason, seems unable to locate or detect it, thus triggering a PHP Fatal error.

It is imperative to note that conducting tests on version 2.4 does not provide a resolution to our current drawback.

engcom-Dash commented 1 year ago

Hi @georgittanchev ,

Thanks for Contribution and collaboration!

Currently we are using magento 2.4 in Mac OS version 12.6.5 and we are using 2.4-develop branch because this is the latest development branch, and it might be possible the issue you mentioned is already been resolve in this branch.

Please try to reproduce the issue in 2.4-develop or latest stable version.

Thanks!

engcom-Dash commented 1 year ago

Hi @georgittanchev ,

Do you need Any further investigation in this issue ???,If it is kindly let me know.

Thanks!

engcom-Dash commented 1 year ago

Hi @georgittanchev ,

As we are not able to get the latest update on the issue. We are closing the issue for now. Please feel free to reopen it or ask us to reopen.

Thanks