Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of undefined constant XML_PI_NODE in symfony 4

Tags:

php

symfony

I'm getting this error in php7.2. I'm using symfony4.

Warning: Use of undefined constant XML_PI_NODE - assumed 'XML_PI_NODE' (this will throw an Error in a future version of PHP)

This is the error line.

in var/cache/dev/ContainerIZRQnYa/getSerializerService.php (line 55)
return $this->services['serializer'] = new \Symfony\Component\Serializer\Serializer([0 => new \Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer(), 1 => new \Symfony\Component\Serializer\Normalizer\DateTimeNormalizer(), 2 => new \Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer(), 3 => new \Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer(), 4 => new \Symfony\Component\Serializer\Normalizer\DataUriNormalizer(), 5 => new \Symfony\Component\Serializer\Normalizer\ArrayDenormalizer(), 6 => new \Symfony\Component\Serializer\Normalizer\ObjectNormalizer($a, new \Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter($a), new \Symfony\Component\PropertyAccess\PropertyAccessor(false, false, new \Symfony\Component\Cache\Adapter\ArrayAdapter(0, false)), NULL, new \Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata($a))], [0 => new \Symfony\Component\Serializer\Encoder\XmlEncoder(), 1 => new \Symfony\Component\Serializer\Encoder\JsonEncoder(), 2 => new \Symfony\Component\Serializer\Encoder\YamlEncoder(), 3 => new \Symfony\Component\Serializer\Encoder\CsvEncoder()]);

I already cleared cache and all permission has setted before. What should i do?

like image 582
Cagrison Avatar asked Apr 05 '20 18:04

Cagrison


1 Answers

I had the same problem, I'd installed PHP XML using

sudo apt install php7.4-xml

but was still getting it. It went away after I ran:

install zlib1g-dev libxml2-dev

like image 76
mickadoo Avatar answered Oct 24 '22 15:10

mickadoo