Magento API错误:仅在开始时允许XML声明


Magento API Error: XML declaration allowed only at the start

我正在尝试访问Magento的核心API。当我尝试访问url http://magentohost/index.php/api/soap/wsdl=1时,我得到错误

This page contains the following errors:
error on line 1 at column 6: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.

我已经安装了xmlrpc、soap和其他据说是必需的扩展,但仍然没有运气。

主机中的其他magento实例显示

This XML file does not appear to have any style information associated with it. The document tree is shown below.

加上下面的XML代码块。

据说我的XML文档可能有空白,但我不知道我应该修改什么XML文档

您可能在一些php/php文件/s开始之后。

前面有空格的xml是无效的,并且会给出类似您的错误。

查看以下链接以获得进一步解释:

https://magento.stackexchange.com/questions/92139/space-added-before-every-magento-page-content

查找注入空格的PHP文件