Laravel - Class "DOMDocument" Not Found - Solved
Hey Artisan,
This article will provide an example of Class "DOMDocument" not found laravel. I explained simply about class 'domdocument' not found php 7. you can understand a concept of class 'domdocument' not found php artisan. let’s discuss about php domdocument not found. follow the below step for php artisan class domdocument not found.
Recently, I was working on my laravel 9 application and I used the "DOMDocument" class to read HTML strings. it's working fine with my local system. But when i uploaded it on the live server then I found the following issue:
"Class "DOMDocument" not found"
I google it and find we need to install php-dom and php-xml extensions. so let's see the below solution.
Solution:
You need to run both command one by one:
sudo apt-get install php-dom
sudo apt-get install php-xml
Solution for PHP 8.2
You need to run both command one by one:
sudo apt-get install php8.2-dom
sudo apt-get install php8.2-xml
Solution for PHP 8.1
You need to run both command one by one:
sudo apt-get install php8.1-dom
sudo apt-get install php8.1-xml
Solution for PHP 8.0
You need to run both command one by one:
sudo apt-get install php8.0-dom
sudo apt-get install php8.0-xml
Solution for PHP 7.4
You need to run both command one by one:
sudo apt-get install php7.4-dom
sudo apt-get install php7.4-xml
Solution for PHP 7.2
You need to run both command one by one:
sudo apt-get install php7.2-dom
sudo apt-get install php7.2-xml
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel Migration Default Value Current Timestamp Example
- How to Add Custom Attribute in Laravel Model?
- How to Use DB Raw Query in Laravel?
- Laravel Get Min Value of Column Example
- Laravel Get Max Value of Column Example
- Laravel E-Signature using Docusign API Tutorial
- Laravel JQuery Ajax Loading Spinner Example
- Laravel Model Disable Primary Key & Auto Increment Example
- Get Array of Ids from Eloquent Models in Laravel
- Laravel Login with Mobile Number OTP Tutorial
- Laravel Move Data from One Table to Another Table Example
- How to Create Word Document File in Laravel?
- Laravel Create Word Document File using phpoffice/phpword package