<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7622</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7622&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How is ‘path_to_root’ set? Or how to reset the working directory?.]]></description>
		<lastBuildDate>Mon, 29 Oct 2018 16:33:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33063#p33063</link>
			<description><![CDATA[<p>@notrinos, thank you so much for that, added for all tabs in cust. supp. and items</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Mon, 29 Oct 2018 16:33:26 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33063#p33063</guid>
		</item>
		<item>
			<title><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33016#p33016</link>
			<description><![CDATA[<p>Please put a copy of the <strong>customer_inquiry.php</strong> to additional_fields/inquiry/<br />Modify the $path_to_root of new customer_inquiry.php to the same as of add_customer.php.<br />Then change the include path in additional_fields/manage/add_customer.php to: <br />include_once(&#039;modules/additional_fields/inquiry/customer_inquiry.php&#039;)</p><p>Don&#039;t need to change anything in the core</p>]]></description>
			<author><![CDATA[null@example.com (notrinos)]]></author>
			<pubDate>Wed, 24 Oct 2018 12:29:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33016#p33016</guid>
		</item>
		<item>
			<title><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32290#p32290</link>
			<description><![CDATA[<p>Can also confirm I was using:-<br /></p><div class="codebox"><pre><code>$new_path_to_root = &quot;../../..&quot;; //new path for includes in customers.php</code></pre></div><p>And<br /></p><div class="codebox"><pre><code>$path_to_root = &quot;../..&quot;; //Old path to pass in session</code></pre></div><p>It seems that once the path is set in the session it remains the same – is this correct?</p><p>I installed on lamp server as well, this did provide slightly different faults:-<br /></p><div class="codebox"><pre><code>include_once(../../includes/db_pager.inc): failed to open stream: No such file or directory in file: /sales/inquiry/customer_inquiry.php at line 14
/sales/inquiry/customer_inquiry.php:14:     include_once()
/modules/additional_fields/manage/add_customers.php:451:     include_once(&#039; /sales/inquiry/customer_inquiry.php&#039;)
include_once(): Failed opening &#039;../../includes/db_pager.inc&#039; for inclusion (include_path=&#039;.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php&#039;) in file: /sales/inquiry/customer_inquiry.php at line 14
/sales/inquiry/customer_inquiry.php:14:     include_once()
/modules/additional_fields/manage/add_customers.php:451:     include_once(&#039; /sales/inquiry/customer_inquiry.php&#039;)</code></pre></div><p>The pear / php path is doubled up isn’t it?</p><p>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</p><br /><p>EDIT</p><p>this maybe interesting</p><p>I changed php ver to 7.0 (Also tried 7.1... same result)</p><p>and the fault changed to:-</p><div class="codebox"><pre><code>(include_path=&#039;.:/opt/cpanel/ea-php70/root/usr/share/pear&#039;)</code></pre></div><p>No mention of .....share/php??????</p><p>Tried changing php ver on wamp, no change in errors - so this maybe a red herring?</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Mon, 23 Jul 2018 20:48:15 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32290#p32290</guid>
		</item>
		<item>
			<title><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32247#p32247</link>
			<description><![CDATA[<p>Then make sure that the original path to root variable also gets passed on as well but as it&#039;s original value.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 20 Jul 2018 16:05:27 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32247#p32247</guid>
		</item>
		<item>
			<title><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32242#p32242</link>
			<description><![CDATA[<p>FAMods is just the name i choose for the root dir.</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Fri, 20 Jul 2018 13:21:35 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32242#p32242</guid>
		</item>
		<item>
			<title><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32239#p32239</link>
			<description><![CDATA[<p>Looks like you downloaded the FAMods into a separate folder and did not integrate it with your FA core.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 20 Jul 2018 03:20:57 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32239#p32239</guid>
		</item>
		<item>
			<title><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32235#p32235</link>
			<description><![CDATA[<p>Changed path_to_root to new_path_to_root</p><p>Now getting the following fatal errors:-</p><div class="codebox"><pre><code>( ! ) Warning: include_once(../../includes/ui/db_pager_view.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\db_pager.inc on line 18
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0027    537576    include_once( &#039;E:\wamp64\www\FAmods\includes\db_pager.inc&#039; )    ...\add_customers.php:16

( ! ) Warning: include_once(): Failed opening &#039;../../includes/ui/db_pager_view.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\db_pager.inc on line 18
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0027    537576    include_once( &#039;E:\wamp64\www\FAmods\includes\db_pager.inc&#039; )    ...\add_customers.php:16

( ! ) Warning: include_once(../../includes/errors.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 374
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../includes/errors.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 374
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: set_error_handler() expects the argument (error_handler) to be a valid callback in E:\wamp64\www\FAmods\includes\session.inc on line 376
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17
3    0.1137    679056    set_error_handler ( )    ...\session.inc:376

( ! ) Warning: set_exception_handler() expects the argument (exception_handler) to be a valid callback in E:\wamp64\www\FAmods\includes\session.inc on line 377
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17
3    0.1594    679040    set_exception_handler ( )    ...\session.inc:377

( ! ) Warning: include_once(../../includes/current_user.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 379
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../includes/current_user.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 379
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(../../frontaccounting.php): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 380
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../frontaccounting.php&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 380
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(../../admin/db/security_db.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 381
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../admin/db/security_db.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 381
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(../../includes/lang/language.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 382
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../includes/lang/language.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 382
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(../../config_db.php): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 383
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../config_db.php&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 383
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(../../includes/ajax.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 384
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../includes/ajax.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 384
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(../../includes/ui/ui_msgs.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 385
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../includes/ui/ui_msgs.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 385
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(../../includes/prefs/sysprefs.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 386
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../includes/prefs/sysprefs.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 386
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(../../includes/hooks.inc): failed to open stream: No such file or directory in E:\wamp64\www\FAmods\includes\session.inc on line 388
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: include_once(): Failed opening &#039;../../includes/hooks.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in E:\wamp64\www\FAmods\includes\session.inc on line 388
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Notice: Undefined variable: installed_extensions in E:\wamp64\www\FAmods\includes\session.inc on line 392
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: Invalid argument supplied for foreach() in E:\wamp64\www\FAmods\includes\session.inc on line 392
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17

( ! ) Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at E:\wamp64\www\FAmods\includes\session.inc:374) in E:\wamp64\www\FAmods\includes\session.inc on line 31
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17
3    0.8302    679304    SessionManager-&gt;sessionStart( )    ...\session.inc:398
4    0.8303    680456    session_start ( )    ...\session.inc:31

( ! ) Fatal error: Class &#039;sys_prefs&#039; not found in E:\wamp64\www\FAmods\includes\session.inc on line 400
Call Stack
#    Time    Memory    Function    Location
1    0.0013    426160    {main}( )    ...\add_customers.php:0
2    0.0641    678720    include_once( &#039;E:\wamp64\www\FAmods\includes\session.inc&#039; )    ...\add_customers.php:17</code></pre></div><p>Recreated the original variable with original path ($path_to_root = &quot;../..&quot;;) whilst keeping path to root in file as new_path_to_root ../../.. but it seems session.inc takes its path from the path used to access it (if that makes sense - path to root is not defined in session.inc)</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Thu, 19 Jul 2018 11:52:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32235#p32235</guid>
		</item>
		<item>
			<title><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32232#p32232</link>
			<description><![CDATA[<p>Use a different variable for your extension&#039;s path to root and it will lapse after it&#039;s scope vanishes.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Thu, 19 Jul 2018 01:20:10 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32232#p32232</guid>
		</item>
		<item>
			<title><![CDATA[How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32227#p32227</link>
			<description><![CDATA[<p>How is ‘path_to_root’ set? Or how to reset the working directory?</p><br /><p>I am writing a small extension to add some additional fields to customers.</p><br /><p>So sales/manage/customers.php<br />Is now modules/additional_fields/manage/ customers.php</p><br /><p>File:&nbsp; /additional_fields/manage/customers.php<br /></p><div class="codebox"><pre><code>Line 13: $path_to_root = &quot;../..&quot;;
Is changed to:-
Line 13: $path_to_root = &quot;../../..&quot;;</code></pre></div><p>The necessary code is added for the additional fields which work as expected.</p><br /><p>However, clicking on the Transactions tab the following error (and 4 others similar appear):-</p><p>include_once(../../includes/db_pager.inc): failed to open stream: No such file or directory in file: /sales/inquiry/customer_inquiry.php at line 14<br />/sales/inquiry/customer_inquiry.php:14: include_once()<br />modules/additional_fields/manage/add_customers.php:449: include_once(&#039; /sales/inquiry/customer_inquiry.php&#039;)</p><p>And</p><p>include_once(): Failed opening &#039;../../includes/db_pager.inc&#039; for inclusion (include_path=&#039;.;C:\php\pear&#039;) in file: sales\inquiry\customer_inquiry.php at line 14<br />sales\inquiry\customer_inquiry.php:14: &nbsp; &nbsp; include_once()<br />modules\additional_fields\manage\add_customers.php:450: &nbsp; &nbsp; include_once(&#039;sales\inquiry\customer_inquiry.php&#039;)</p><p>(Similar errors appear on the Sales Orders tab)</p><p>If the path_to_root in customer_inquiry.php is changed to ../../.. then it works, but obviously now I cannot access Sales -&gt; Customer Transaction Inquiry as numerous fatal errors appear.</p><br /><p>How do I reset the working directory?</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Tue, 17 Jul 2018 17:31:32 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32227#p32227</guid>
		</item>
	</channel>
</rss>
