<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Broken ajax functionality in newer php installation]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=6451</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6451&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Broken ajax functionality in newer php installation.]]></description>
		<lastBuildDate>Fri, 02 Sep 2016 17:35:45 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Broken ajax functionality in newer php installation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26238#p26238</link>
			<description><![CDATA[<p>Using FA v2.3.25+ with PHP version &lt; 5.6 is recommended for production.</p><p>Check the value of the variable <strong>always_populate_raw_post_data</strong> in your <em>php.ini</em> in PHP 5.6 when your errors come.</p><p>Increase the timeout value for script execution and input time in php.ini for bigger results.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 02 Sep 2016 17:35:45 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26238#p26238</guid>
		</item>
		<item>
			<title><![CDATA[Re: Broken ajax functionality in newer php installation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26236#p26236</link>
			<description><![CDATA[<div class="quotebox"><cite>apmuthu wrote:</cite><blockquote><p>In PHP v5.6 onwards this behavior is so. Restart the webserver after including the following line in the <strong>php.ini</strong> file:<br /></p><div class="codebox"><pre><code>always_populate_raw_post_data = -1</code></pre></div><p>The caveat for the above would be an inability to upload files as discussed <a href="https://github.com/splitbrain/dokuwiki/issues/1104">here</a>. The newer recommended construct for Ajax is to use <strong>php://input</strong> stream that does not have the above issue.</p></blockquote></div><p>So, does the main problem lie in fa using deprecated ajax constructs?</p><p>Is the best solution to use PHP &lt;5.6 if I am using fa for commercial deployment?</p>]]></description>
			<author><![CDATA[null@example.com (justapeddler)]]></author>
			<pubDate>Fri, 02 Sep 2016 12:47:18 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26236#p26236</guid>
		</item>
		<item>
			<title><![CDATA[Re: Broken ajax functionality in newer php installation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26235#p26235</link>
			<description><![CDATA[<p>Yes ,<br />@ apmuthu&nbsp; your right</p><p>; Always populate the $HTTP_RAW_POST_DATA variable. PHP&#039;s default behavior is<br />; to disable this feature and it will be removed in a future version.<br />; If post reading is disabled through enable_post_data_reading,<br />; $HTTP_RAW_POST_DATA is *NOT* populated.<br />; http://php.net/always-populate-raw-post-data<br />always_populate_raw_post_data = -1</p><p>its should be made -1,</p><p>as when i install new version of WAMP ( which came latest php/mysql version ) ....<br />my edit / add function was taking to much time ...</p><p>i did above changes in php.ini..... and it solved my solution ..... </p><p>but still struggle to find solution for bigger result <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (tester1)]]></author>
			<pubDate>Fri, 02 Sep 2016 11:29:39 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26235#p26235</guid>
		</item>
		<item>
			<title><![CDATA[Re: Broken ajax functionality in newer php installation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26231#p26231</link>
			<description><![CDATA[<p>In PHP v5.6 onwards this behavior is so. Restart the webserver after including the following line in the <strong>php.ini</strong> file:<br /></p><div class="codebox"><pre><code>always_populate_raw_post_data = -1</code></pre></div><p>The caveat for the above would be an inability to upload files as discussed <a href="https://github.com/splitbrain/dokuwiki/issues/1104">here</a>. The newer recommended construct for Ajax is to use <strong>php://input</strong> stream that does not have the above issue.</p><p>If you are using the <a href="https://github.com/FrontAccountingERP/FA/archive/master.zip">latest code from GitHub</a> / SF Git, (for FA v2.3.25+) you will find <strong>HTTP_RAW_POST_DATA</strong> is so in line 264:<br /></p><div class="codebox"><pre><code>        $rawPost = strcasecmp($_SERVER[&#039;REQUEST_METHOD&#039;], &#039;POST&#039;) == 0? (isset($GLOBALS[&#039;HTTP_RAW_POST_DATA&#039;])? $GLOBALS[&#039;HTTP_RAW_POST_DATA&#039;] : @file_get_contents(&quot;php://input&quot;)) : null;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 02 Sep 2016 10:15:52 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26231#p26231</guid>
		</item>
		<item>
			<title><![CDATA[Broken ajax functionality in newer php installation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26227#p26227</link>
			<description><![CDATA[<p>I&#039;m running fa under xampp. Some ajax functionality is broken (always result in timeouts) when used in newer php environments. Most problems are from form data editing or submitting new data.</p><p>Here is a little data on such error<br /></p><div class="codebox"><pre><code>error
[Thu Sep 01 19:13:58.342566 2016] [:error] [pid 14080:tid 1632] [client 127.0.0.1:56914] PHP Deprecated:  Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set &#039;always_populate_raw_post_data&#039; to &#039;-1&#039; in php.ini and use the php://input stream instead. in Unknown on line 0, referer: http://127.0.0.1/fa/inventory/manage/locations.php?
[Thu Sep 01 19:13:58.342566 2016] [:error] [pid 14080:tid 1632] [client 127.0.0.1:56914] PHP Warning:  Cannot modify header information - headers already sent in Unknown on line 0, referer: http://127.0.0.1/fa/inventory/manage/locations.php?
[Thu Sep 01 19:13:58.364568 2016] [:error] [pid 14080:tid 1632] [client 127.0.0.1:56914] PHP Notice:  Trying to get property of non-object in C:\\xampp\\htdocs\\fa\\includes\\errors.inc on line 74, referer: http://127.0.0.1/fa/inventory/manage/locations.php?

access
127.0.0.1 - - [01/Sep/2016:19:13:58 +0700] &quot;POST /fa/inventory/manage/locations.php?JsHttpRequest=0-xml HTTP/1.1&quot; 200 570 &quot;http://127.0.0.1/fa/inventory/manage/locations.php?&quot; &quot;Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0&quot;

Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.15

Current database version Required  2.4.1 </code></pre></div><p>Fa doesn&#039;t return any error if I turn off javascript.</p><br /><p>Tested with older deployment of xampp using php 5.3.1 and ajax works fine without timeouts.</p><p>Any idea to what I can do to fix the ajax timeout error?</p><p>EDIT: tested with php 5.4.31 and also no errors</p>]]></description>
			<author><![CDATA[null@example.com (justapeddler)]]></author>
			<pubDate>Thu, 01 Sep 2016 13:30:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26227#p26227</guid>
		</item>
	</channel>
</rss>
