hass1980 Posted April 23, 2009 Share Posted April 23, 2009 Hi New to php so need some direction on how to set the php_include_path. Im trying to setup the following, from a tutorial. Also I am using WAMP. These scripts use a require statement that calls "Cart.php" In order for this to work properly, you need to set PHP's include path so that it will look in the Cart root directory. If your web server allows .htaccess files to override Apache config file settings, then place a file called .htaccess in you Cart root directory with the following line: php3_include_path /path/to/Cart If you cannot override Apache config file settings through .htaccess, then you can place the above line in your web server's directive in the Apache config files. For PHP4, this may be changed to "php4_include_path" or "php_include_path" - I'm not sure as PHP4 is still in beta at the time of this writing. If you use a web server other than Apache, you will need to check your web server's documentation for details. If you can't do either of those, create a PHP script which contains the following line: <? phpinfo(); ?> When you view that script in a web browser, you will see a directive called "include_path" in the Configuration table. Place the Cart.php file in one of the directories listed. If you can't make anything work, change the require(...) statement in the files of the admin directory to read: require("../Cart.php"); Quote Link to comment https://forums.phpfreaks.com/topic/155318-setup-your-php_include_path/ Share on other sites More sharing options...
Mchl Posted April 23, 2009 Share Posted April 23, 2009 It seems you're using awfully old tutorial... We're having PHP5.3 around the corner... Click on the WAMP icon in tray, select PHP > php.ini In the file that opens, search for "include_path" Set it as needed. Quote Link to comment https://forums.phpfreaks.com/topic/155318-setup-your-php_include_path/#findComment-817140 Share on other sites More sharing options...
hass1980 Posted April 23, 2009 Author Share Posted April 23, 2009 would this be under the following? ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" ; ; Windows: "\path1;\path2" ;include_path = ".;c:\wamp\www\cart" <----- changed, this correct??? Quote Link to comment https://forums.phpfreaks.com/topic/155318-setup-your-php_include_path/#findComment-817143 Share on other sites More sharing options...
Mchl Posted April 23, 2009 Share Posted April 23, 2009 Yup. You can got to http://localhost/index.php?phpinfo=1 and check if the modified path is visible (it's in 'Configuration - PHP Core' table) Quote Link to comment https://forums.phpfreaks.com/topic/155318-setup-your-php_include_path/#findComment-817161 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.