php – 解析器错误:期望开始标记,找不到“<”

前端之家收集整理的这篇文章主要介绍了php – 解析器错误:期望开始标记,找不到“<”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我是第一次使用 PHP.我正在使用PHP示例在ebay沙箱上上传图片.我在运行PHP文件时收到以下错误
PHP Warning:  simplexml_load_string(): Entity: line 1: parser error : Start tag expected,'<' not found in /home/nish/stuff/market place/test/PHP5/UploadImage/UploadSiteHostedPictures.PHP on line 69
PHP Warning:  simplexml_load_string(): HTTP/1.1 200 OK in /home/nish/stuff/market place/test/PHP5/UploadImage/UploadSiteHostedPictures.PHP on line 69
PHP Warning:  simplexml_load_string(): ^ in /home/nish/stuff/market place/test/PHP5/UploadImage/UploadSiteHostedPictures.PHP on line 69
PHP Notice:  Trying to get property of non-object in /home/nish/stuff/market place/test/PHP5/UploadImage/UploadSiteHostedPictures.PHP on line 92
PHP Notice:  Trying to get property of non-object in /home/nish/stuff/market place/test/PHP5/UploadImage/UploadSiteHostedPictures.PHP on line 93
PHP Notice:  Trying to get property of non-object in /home/nish/stuff/market place/test/PHP5/UploadImage/UploadSiteHostedPictures.PHP on line 93
PHP Notice:  Trying to get property of non-object in /home/nish/stuff/market place/test/PHP5/UploadImage/UploadSiteHostedPictures.PHP on line 94
PHP Notice:  Trying to get property of non-object in /home/nish/stuff/market place/test/PHP5/UploadImage/UploadSiteHostedPictures.PHP on line 94

相关的是:

69. $respXmlObj = simplexml_load_string($respXmlStr);     // create SimpleXML object from string for easier parsing
                                                      // need SimpleXML library loaded for this

92. $ack        = $respXmlObj->Ack;
93. $picNameOut = $respXmlObj->SiteHostedPictureDetails->PictureName;
94. $picURL     = $respXmlObj->SiteHostedPictureDetails->FullURL;

我能理解的是respXMLObj没有正确设置.我已经检查过启用了simleXML支持.

请有人帮我调试一下.谢谢

你引用的代码有这一行:
//curl_setopt($connection,CURLOPT_HEADER,1 ); // Uncomment these for debugging

好像你没有注释这些.这将导致在您的响应中获取HTTP标头.哪个可以调试,但它会在simplexml_load_string中创建XML解析错误.

要么再次注释,要么将0作为其值.

猜你在找的PHP相关文章