Page 1 of 1

include_path problems from php.ini

Posted: Mon Feb 14, 2011 8:11 am
by skytreader
Hi. I'm trying to set-up my include_path from php.ini but they don't seem to work. I have tried the following:

Code: Select all

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;C:\xampp\htdocs\gradegrid\boilerplate\php"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path
include_path = ".;C:\xampp\php\PEAR"

Code: Select all

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
; include_path = ".;C:\xampp\htdocs\gradegrid\boilerplate\php" <- now commented out
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path
include_path = ".;C:\xampp\php\PEAR;C:\xampp\htdocs\gradegrid\boilerplate\php"
In my php file, I just type

Code: Select all

include("initialize.php");
Where initialize.php is a file located at C:\xampp\htdocs\gradegrid\boilerplate\php.

But all I get are errors particularly
No such file or directory in C:\xampp\htdocs\gradegrid\index.php on line 3
Failed opening 'initialize.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\gradegrid\index.php on line 3
on both attempts.

Now, I have a clue why my first attempt (at php.ini) didn't work but I cannot understand what's wrong with the second one. I managed to make it work though; I put my boilerplate folder at PEAR and then included "boilerplate/php/initialize.php". Any thoughts?

Re: include_path problems from php.ini

Posted: Mon Feb 14, 2011 12:23 pm
by AbraCadaver
You restarted your webserver after changing php.ini?

Re: include_path problems from php.ini

Posted: Tue Feb 15, 2011 12:45 pm
by skytreader
Uh...alright...I didn't know I was supposed to reset it. Thanks AbraCadaver.

Re: include_path problems from php.ini

Posted: Tue Feb 15, 2011 1:06 pm
by AbraCadaver
skytreader wrote:Uh...alright...I didn't know I was supposed to reset it. Thanks AbraCadaver.
Yes, the webserver loads the ini file only when it first starts, so any changes to the ini file require a restart of the webserver.