Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined function xml_parser_create()

Could you please help me in resolving this conflict. I am tryin to run a xml_parse_create.
My server configurations:
[root@server ~]# php -v
PHP 7.0.22 (cli) (built: Aug 7 2017 16:18:27) ( NTS )

[root@server ~]# nginx -v
nginx version: nginx/1.10.2

OS: CentOS 7.3.1611 (Core)

Details of my YUM installation:

[root@server ~]# yum list installed | grep php
php70u-cli.x86_64                       7.0.22-2.ius.centos7           @ius     
php70u-common.x86_64                    7.0.22-2.ius.centos7           @ius     
php70u-fpm.x86_64                       7.0.22-2.ius.centos7           @ius     
php70u-fpm-nginx.noarch                 7.0.22-2.ius.centos7           @ius     
php70u-mysqlnd.x86_64                   7.0.22-2.ius.centos7           @ius     
php70u-pdo.x86_64                       7.0.22-2.ius.centos7           @ius  

Here is the details of the investigation:

I tried executing following code in test.php:

<?php
$xml_parser = xml_parser_create("");
print $xml_parser;<br>
?>

[root@server ~]# php /tmp/test.php
PHP Fatal error: Uncaught Error: Call to undefined function

[root@server ~]# sudo yum install php-xml
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: repo1.ash.innoscale.net
* epel: fedora-epel.mirrors.tds.net
* extras: mirror.es.its.nyu.edu
* ius: ius.mirror.constant.com
* remi-safe: repo1.ash.innoscale.net
* updates: mirrors.advancedhosters.com
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php-xml.x86_64 0:5.4.16-42.el7 will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.16-42.el7 for package: php-xml-5.4.16-42.el7.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.4.16-42.el7 will be installed
--> Processing Conflict: php70u-common-7.0.22-2.ius.centos7.x86_64 conflicts php-common < 7.0.22
--> Finished Dependency Resolution
Error: php70u-common conflicts with php-common-5.4.16-42.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

like image 518
Dibya Sahoo Avatar asked Aug 28 '17 06:08

Dibya Sahoo


1 Answers

Under ubuntu you can do the same as @Tarun pointed

apt-get install php-xml
apt-get search php |grep xml
like image 131
Yu Jiaao Avatar answered Oct 10 '22 13:10

Yu Jiaao