php.ini and "include_path"

by default with 10.5 Server, "include_path" within /etc/php.ini is commented out.

; UNIX: "/path1:/path2"
; include_path = ".:/php/includes"


in general, other than uncommenting the second line, is there anything else i should be aware of?

thanks!

G5 dual 2.7, Mac OS X (10.4.8)

Posted on Mar 3, 2008 9:02 AM

Reply
2 replies

Mar 3, 2008 7:36 PM in response to alternapop

You can read about the include_path directive here:

http://www.php.net/manual/en/ini.php#ini.list
http://www.php.net/manual/en/ini.core.php#ini.include-path

It is useful for including libraries and classes that were not installed with a compile of PHP. For example, if your version of PHP is compiled without the PEAR/PECL libraries...

http://pear.php.net/manual/en/introduction.php

like Apple's installed PHP Apache module is, then you can add PEAR by installing it in directory and adding its path to the include_path directive, thereby allowing your scripts to find the libraries without having to set the full path to include them.

http://pear.php.net/manual/en/installation.shared.php

This directive can be configured in php.ini, .htaccess and server config files (PHP INIALL).

Larry

Mar 3, 2008 7:45 PM in response to alternapop

Also,the PHP docs read 'Using a . in the include path allows for relative includes as it means the current directory.' While this is useful, there are instances where setting the include_path directive to '.' in your php.ini file will cause problems with your script system. I can't remember if it is with Joomla or SquirrelMail. I would avoid this in php.ini and use it in your scripts with ini_set() or in .htaccess files for local referencing only.

Larry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

php.ini and "include_path"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.