在 symfony 4 中使用未定义的常量 XML_PI_NODE [英] Use of undefined constant XML_PI_NODE in symfony 4

查看:27
本文介绍了在 symfony 4 中使用未定义的常量 XML_PI_NODE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 php7.2 中遇到此错误.我正在使用 symfony4.

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)

这是错误行.

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?

推荐答案

我遇到了同样的问题,我使用

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:

安装 zlib1g-dev libxml2-dev

这篇关于在 symfony 4 中使用未定义的常量 XML_PI_NODE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆