pre - shop网站服务:<![CDATA[内部错误.要查看此错误,请显示PHP错误.]]>


Prestashop web service: <![CDATA[Internal error. To see this error please display the PHP errors.]]>

此呼叫

curl -H "Content-type: application/xml" -vX POST 'http://blablablabla@local.acme.net/api/products/' -d "<?xml version='"1.0'" 
encoding='"UTF-8'"?>
<prestashop xmlns:xlink='"http://www.w3.org/1999/xlink'">
<product>
</product>
</prestashop>"

总是返回

< HTTP/1.1 400 Bad Request
< Date: Wed, 14 Sep 2016 14:26:02 GMT
< Server: Apache/2.4.18 (Unix) PHP/5.5.34
< Vary: Authorization
< X-Powered-By: PrestaShop Webservice
< Access-Time: 1473863162
< PSWS-Version: 1.6.1.7
< Execution-Time: 0.024
< Content-Length: 241
< Connection: close
< Content-Type: text/xml;charset=utf-8
<
<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<errors>
<error>
<message><![CDATA[Internal error. To see this error please display the PHP errors.]]></message>
</error>
</errors>
</prestashop>
* Closing connection 0

但是PHP日志中没有关于这个错误的内容。发生什么事情了?我该如何解决这个问题呢?

in config/definitions .inc.php将常量更改为:

define('_PS_MODE_DEV_', true);

,你会得到预期的错误信息:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<errors>
<error>
<code><![CDATA[41]]></code>
<message><![CDATA[parameter "price" required]]></message>
</error>
</errors>
</prestashop>