Search code examples
phpjenkinstestlink

Cannot stop deprecated warning in PHP


I seem to be hitting the problem described in this blog titled PHP 5.6: “Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version.”. As can be seen in this output of ngrep on my server:

HTTP/1.1 200 OK..Date: Mon, 09 Mar 2015 20:28:06 GMT..Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0j DAV/2 PHP/5.6.2..Content-Length: 819..
Keep-Alive: timeout=5, max=100..Connection: Keep-Alive..Content-Type: text/html; charset=UTF-8....<br />.<b>Deprecated</b>:  Automatically populating
$HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini
and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br />.<br />.<b>Warning</b>:  Cannot modify header information - headers
already sent in <b>Unknown</b> on line <b>0</b><br />.<?xml version="1.0"?>.<methodResponse>.  <params>.    <param>.      <value>.
<array><data>.  <value><struct>.  <member><name>code</name><value><int>2000</int></value></member>.  <member><name>message</name><value><string>
(check  DevKey) - Can not authenticate client: invalid developer key</string></value></member>.</struct></value>.</data></array>.   </value>.
</param>.  </params>.</methodResponse>. 

This message is what is being returned to Jenkins TestLink Plugin when it attempts to communicate to TestLink via XML-RPC. You can see clearly that the deprecated warning is preceding the XML response, which in turn causes the "modify header information" issue.

But, what I don't get is that I can't seem to suppress this warning. If I set always_populate_raw_post_data = -1 it seems to have no effect. I thought perhaps I was editing the wrong php.ini file, but I followed the suggestion here and was able to verify that changes I make are being picked up by the server. My only theory is that TestLink is overriding these values in the application but I can't seem to find anything related in my installation.

EDIT: Some Environment Info: Apache 2.2.15-39 on port 80, with PHP 5.6.6-1 and TestLink 1.9.13 using MySQL 5.1.73. Jenkins 1.601 on Tomcat 8.0.20 running on port 8089.

If I look closely at the message above I see PHP/5.6.2, yet if I do a find on my system find / -type f -name php I get only /usr/bin/php...


Solution

  • Well, I learned a lot, while digging into this, but as it turned out my mistake was quite simple. I had copied the XML-RPC URL from some documentation into the configuration of the Jenkins Testlink Plugin, and forgot to edit it to be the URL for my server.