<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7622&amp;type=atom" />
	<updated>2018-10-29T16:33:26Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7622</id>
		<entry>
			<title type="html"><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33063#p33063" />
			<content type="html"><![CDATA[<p>@notrinos, thank you so much for that, added for all tabs in cust. supp. and items</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-10-29T16:33:26Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33063#p33063</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33016#p33016" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2018-10-24T12:29:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33016#p33016</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32290#p32290" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-07-23T20:48:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32290#p32290</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32247#p32247" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-07-20T16:05:27Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32247#p32247</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32242#p32242" />
			<content type="html"><![CDATA[<p>FAMods is just the name i choose for the root dir.</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-07-20T13:21:35Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32242#p32242</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32239#p32239" />
			<content type="html"><![CDATA[<p>Looks like you downloaded the FAMods into a separate folder and did not integrate it with your FA core.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-07-20T03:20:57Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32239#p32239</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32235#p32235" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-07-19T11:52:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32235#p32235</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32232#p32232" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-07-19T01:20:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32232#p32232</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How is ‘path_to_root’ set? Or how to reset the working directory?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32227#p32227" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-07-17T17:31:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32227#p32227</id>
		</entry>
</feed>
