I'm learning laravel. But after running the command composer update it is showing me this error.
I've already done this -> apt-get install php7.4-xml and apt-get install php-xml
I just want to know which line should I add to the file php.ini to enable the PHP's xml extension. Thanks in Advance.
php--version
PHP 7.4.22 (cli) (built: Jul 30 2021 13:08:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.22, Copyright (c), by Zend Technologies
Result of composer udpate
aman@aman-HP-Notebook:~/AMAN/learnLaravel$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpunit/phpunit[9.3.3, ..., 9.5.x-dev] require ext-xml * -> it is missing from your system. Install or enable PHP's xml extension.
- Root composer.json requires phpunit/phpunit ^9.3.3 -> satisfiable by phpunit/phpunit[9.3.3, ..., 9.5.x-dev].To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.4/cli/php.ini
- /etc/php/7.4/cli/conf.d/10-opcache.ini
- /etc/php/7.4/cli/conf.d/10-pdo.ini
- /etc/php/7.4/cli/conf.d/20-calendar.ini
- /etc/php/7.4/cli/conf.d/20-ctype.ini
- /etc/php/7.4/cli/conf.d/20-exif.ini
- /etc/php/7.4/cli/conf.d/20-ffi.ini
- /etc/php/7.4/cli/conf.d/20-fileinfo.ini
- /etc/php/7.4/cli/conf.d/20-ftp.ini
- /etc/php/7.4/cli/conf.d/20-gettext.ini
- /etc/php/7.4/cli/conf.d/20-iconv.ini
- /etc/php/7.4/cli/conf.d/20-json.ini
- /etc/php/7.4/cli/conf.d/20-phar.ini
- /etc/php/7.4/cli/conf.d/20-posix.ini
- /etc/php/7.4/cli/conf.d/20-readline.ini
- /etc/php/7.4/cli/conf.d/20-shmop.ini
- /etc/php/7.4/cli/conf.d/20-sockets.ini
- /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.4/cli/conf.d/20-sysvsem.ini
- /etc/php/7.4/cli/conf.d/20-sysvshm.ini
- /etc/php/7.4/cli/conf.d/20-tokenizer.ini
- /etc/php/7.4/cli/conf.d/20-zip.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
result of sudo apt search php-xml
i php-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
v php-xml:i386 -
p php-xml-htmlsax3 - SAX parser for HTML and other badly formed XML documents
p php-xml-rpc2 - PHP XML-RPC client/server library
p php-xml-svg - XML_SVG API
v php-xml-util -
v php-xmlreader -
v php-xmlreader:i386 -
p php-xmlrpc - XML-RPC servers and clients functions for PHP
v php-xmlrpc:i386 -
p php-xmlrpc-all-dev - XML-RPC servers and clients functions for PHP
v php-xmlwriter -
v php-xmlwriter:i386 -
output of php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
This PHP extension is usually enabled by default but if you're on Ubuntu there's a chance it isn't.
To resolve this you just need to install the php-xml extension via apt-get.
Run the following: apt-get install php-xml
If you get the following error(s): 404 Not Found on running that command then you likely just need to update via apt-get update and then run the php-xml command again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With