LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-22-2009, 01:43 PM   #1
linfidel
LQ Newbie
 
Registered: Sep 2008
Location: Left Coast, USA
Distribution: Ubuntu Hardy
Posts: 15

Rep: Reputation: 0
mystery php include_path setting


I've been learning PHP lately, and so far, so good. My web server seems to be working for the tutorials, examples, etc.

Then, I came across a post for smarty, which seemed like it might be nice, so I downloaded it, and the install said to copy some files to my PHP include_path. So, I ran "php -i | grep include_path" to find out how this was currently set, and got a setting that I can't figure out.

The setting I got was:
.:/usr/share/php:/usr/share/pear
2 out of 3 of those don't exist; there is a php5, but no pear in /usr/share
In Windows, I noticed a similarly non-existent setting:
include_path .;C:\php5\pear

I looked everywhere I could think of - mainly all php.ini, none of which actually had any include_path set, I checked .htaccess in my www root (I don't have one), and I looked at the include for phpinfo.php to see if it had anything that might do this.

I suppose it's not a problem, since it works OK.

I created a smarty.ini file in the folder /etc/php5/conf.d, saying:
[Smarty]
include_path = ${include_path} ":/usr/share/php5/Smarty"

Now my include_path is ":/usr/share/php5/Smarty", so it seems that the include_path is empty at that point. Maybe the path I was seeing was some sort of default for something if nothing else was set, but it seems pretty weird to set some arbitrary path.

Anyone have any clue? By the way, this is Ubuntu Jaunty Jackelope.
 
Old 08-22-2009, 02:20 PM   #2
walruz
Member
 
Registered: Aug 2009
Location: Buenos Aires
Distribution: Debian/GNU Linux
Posts: 35

Rep: Reputation: 17
Hello there.

I'm not sure about ${include_path} working. You may want to try

PHP Code:
<?php
$path 
'/usr/share/php5/Smarty';
set_include_path(get_include_path() . PATH_SEPARATOR $path);
?>
Cheers,
W
 
Old 08-22-2009, 03:13 PM   #3
linfidel
LQ Newbie
 
Registered: Sep 2008
Location: Left Coast, USA
Distribution: Ubuntu Hardy
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by walruz View Post
Hello there.

I'm not sure about ${include_path} working. You may want to try

PHP Code:
<?php
$path 
'/usr/share/php5/Smarty';
set_include_path(get_include_path() . PATH_SEPARATOR $path);
?>
Cheers,
W
Thanks - but setting the path wasn't really my problem, as the method I used for the ini file in conf.d works OK. I'm mainly trying to understand where this bogus path comes from in the first place, and whether I need to figure out what to use instead.

But I'll keep your suggestion handy, just in case I need it later.

Last edited by linfidel; 08-22-2009 at 03:15 PM.
 
Old 08-22-2009, 03:25 PM   #4
walruz
Member
 
Registered: Aug 2009
Location: Buenos Aires
Distribution: Debian/GNU Linux
Posts: 35

Rep: Reputation: 17
Quote:
Originally Posted by linfidel View Post
I'm mainly trying to understand where this bogus path comes from in the first place, and whether I need to figure out what to use instead.
Even if you comment the include_path, php will load some (internal) default values, which are the ones that you're seeing. Those are (i think) the standard installation paths for php & pear.

Glad I helped,
W
 
  


Reply

Tags
php


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
include_path for Zend vargadanis Programming 5 09-03-2007 11:36 PM
to setup include_path in php.ini for pear sailu_mvn Linux - Software 1 07-13-2006 03:10 AM
IRM 1.5.7 include_path error bussxr Linux - General 0 06-04-2006 08:55 PM
Failed opening '../main/mainconfig.php' for inclusion (include_path='.:/usr/local/lib ryancoolest Linux - Newbie 3 09-29-2004 09:10 PM
'PEAR.php' (include_path=''.:/usr/local/lib/php'') SOLVED SOLVED adengua Linux - Software 0 04-02-2004 03:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration