Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

访问server.php的时候,Wechat.php on line 125 报错了。 #1

Closed
forecho opened this issue May 18, 2013 · 6 comments
Closed

访问server.php的时候,Wechat.php on line 125 报错了。 #1

forecho opened this issue May 18, 2013 · 6 comments

Comments

@forecho
Copy link

forecho commented May 18, 2013

后来我自己解决了,解决办法是把Wechat.php 文件里面所有<xml>...</xml>旁边的<<<XMLXML换成引号

@netputer
Copy link
Owner

请问你的服务器的 PHP 版本是几多,按理来说这种格式应该普遍支持的。

@forecho
Copy link
Author

forecho commented May 18, 2013

PHP 5.2.17

@netputer
Copy link
Owner

能否提供一下当时报错的具体内容呢?

@forecho
Copy link
Author

forecho commented May 18, 2013

Parse error: syntax error, unexpected T_START_HEREDOC in ../weixin/src/Wechat.php on line 125
125行的代码就是:

protected $template = <<<XML
<xml>
  <ToUserName><![CDATA[%s]]></ToUserName>
  <FromUserName><![CDATA[%s]]></FromUserName>
  <CreateTime>%s</CreateTime>
  <MsgType><![CDATA[text]]></MsgType>
  <Content><![CDATA[%s]]></Content>
  <FuncFlag>%s<FuncFlag>
</xml>
XML;

@netputer
Copy link
Owner

@forecho 测试一下问题是否解决?

@forecho
Copy link
Author

forecho commented May 20, 2013

@netputer OK了,沒有错误了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants