{"action":"opened","issue":{"url":"https://api.github.com/repos/overtrue/wechat/issues/520","repository_url":"https://api.github.com/repos/overtrue/wechat","labels_url":"https://api.github.com/repos/overtrue/wechat/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/overtrue/wechat/issues/520/comments","events_url":"https://api.github.com/repos/overtrue/wechat/issues/520/events","html_url":"https://github.com/overtrue/wechat/issues/520","id":184216445,"number":520,"title":"$_SERVER['SERVER_ADDR'] 在mac php7中获取不到","user":{"login":"dongm2ez","id":9032795,"avatar_url":"https://avatars.githubusercontent.com/u/9032795?v=3","gravatar_id":"","url":"https://api.github.com/users/dongm2ez","html_url":"https://github.com/dongm2ez","followers_url":"https://api.github.com/users/dongm2ez/followers","following_url":"https://api.github.com/users/dongm2ez/following{/other_user}","gists_url":"https://api.github.com/users/dongm2ez/gists{/gist_id}","starred_url":"https://api.github.com/users/dongm2ez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongm2ez/subscriptions","organizations_url":"https://api.github.com/users/dongm2ez/orgs","repos_url":"https://api.github.com/users/dongm2ez/repos","events_url":"https://api.github.com/users/dongm2ez/events{/privacy}","received_events_url":"https://api.github.com/users/dongm2ez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-20T12:31:32Z","updated_at":"2016-10-20T12:31:32Z","closed_at":null,"body":"使用支付报错，报错是\r\n```\r\n\"return_code\" => \"FAIL\"\r\n\"return_msg\" => \"spbill_create_ip参数长度有误\"\r\n  ```\r\n查找源码 在获取这个值的地方扫码支付使用的是\r\nfunction get_server_ip()\r\n{\r\n    // for php-cli(phpunit etc.)\r\n    if (empty($_SERVER['SERVER_ADDR'])) {\r\n        return gethostbyname(gethostname());\r\n    }\r\n\r\n    return $_SERVER['SERVER_ADDR'];\r\n}\r\n\r\n但是 $_SERVER['SERVER_ADDR'] 是空的，而获取的gethostname() 为本机的机器名不是IP地址"}}
{"actor":{"display_login":"dongm2ez"}}