<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Broken ajax functionality in newer php installation]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6451&amp;type=atom" />
	<updated>2016-09-02T17:35:45Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6451</id>
		<entry>
			<title type="html"><![CDATA[Re: Broken ajax functionality in newer php installation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=26238#p26238" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-09-02T17:35:45Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=26238#p26238</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Broken ajax functionality in newer php installation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=26236#p26236" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2016-09-02T12:47:18Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=26236#p26236</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Broken ajax functionality in newer php installation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=26235#p26235" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[tester1]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18290</uri>
			</author>
			<updated>2016-09-02T11:29:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=26235#p26235</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Broken ajax functionality in newer php installation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=26231#p26231" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-09-02T10:15:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=26231#p26231</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Broken ajax functionality in newer php installation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=26227#p26227" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2016-09-01T13:30:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=26227#p26227</id>
		</entry>
</feed>
