include_path problems from php.ini

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
skytreader
Forum Newbie
Posts: 7
Joined: Wed Sep 09, 2009 12:31 pm

include_path problems from php.ini

Post 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?
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: include_path problems from php.ini

Post by AbraCadaver »

You restarted your webserver after changing php.ini?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
skytreader
Forum Newbie
Posts: 7
Joined: Wed Sep 09, 2009 12:31 pm

Re: include_path problems from php.ini

Post by skytreader »

Uh...alright...I didn't know I was supposed to reset it. Thanks AbraCadaver.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: include_path problems from php.ini

Post 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.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply