View previous topic :: View next topic |
Author |
Message |
kleinishere n00b
Joined: 23 Nov 2003 Posts: 37
|
Posted: Mon Apr 12, 2004 1:29 am Post subject: php include_path |
|
|
I have been running a windows apache 2.0.48 server and have been using require just fine. All I have had to do is type in require("myfilehere"). myfilehere has just been the file relative to the DocumentRoot in window's httpd.conf file. My DocumentRoot in windows was C:\, very insecure I know.
Now I have switched over to apache, have php running and all, but when I use requires it has trouble with the include_path. In windows i never had to change anything for this. I was just able to require the file relative to the DocumentRoot. Now my DocumentRoot is set to /mnt/lshare. I want to just set my include_path to the DocumentRoot so my code will still function correctly.
Can anyone help me?! _________________ Pain is weakness leaving the body. |
|
Back to top |
|
|
johnmc Tux's lil' helper
Joined: 04 Oct 2003 Posts: 81 Location: Kansas City, MO
|
Posted: Mon Apr 12, 2004 1:38 am Post subject: |
|
|
The PHP libraries and extensions seem to install under /usr/lib/php. The /etc/php/php.ini file include_path directive can be used to add additional search directories.
Good luck! _________________ Pass the ribs!
----------------------------
17" G4 1.5GHZ Powerbook
Toshiba 5205-S703
----------------------------
"Survived the Dotcom crash and happily toiling for the print media again" |
|
Back to top |
|
|
kleinishere n00b
Joined: 23 Nov 2003 Posts: 37
|
Posted: Mon Apr 12, 2004 1:43 am Post subject: |
|
|
I realize that and I've tried to change the include_path in php.ini.
My question is this:
My DocumentRoot is /mnt/lshare
How do i set my include_path so that it will be /mnt/lshare and look through that? _________________ Pain is weakness leaving the body. |
|
Back to top |
|
|
johnmc Tux's lil' helper
Joined: 04 Oct 2003 Posts: 81 Location: Kansas City, MO
|
Posted: Mon Apr 12, 2004 1:55 am Post subject: |
|
|
kleinishere wrote: | How do i set my include_path so that it will be /mnt/lshare and look through that? |
Add /mnt/lshare to the include path, to make it look like this:
include_path = ".:/usr/lib/php:/mnt/lshare" , for example. Just add a colon and /mnt/lshare at the end of it. _________________ Pass the ribs!
----------------------------
17" G4 1.5GHZ Powerbook
Toshiba 5205-S703
----------------------------
"Survived the Dotcom crash and happily toiling for the print media again" |
|
Back to top |
|
|
kleinishere n00b
Joined: 23 Nov 2003 Posts: 37
|
Posted: Mon Apr 12, 2004 1:59 am Post subject: |
|
|
i also have this problem on readdir(). i have to put the absolute path. instead of /www/news i have to put /mnt/lshare/www/news. is there anyway that i can change it to just assume /mnt/lshare _________________ Pain is weakness leaving the body.
Last edited by kleinishere on Mon Apr 12, 2004 2:16 am; edited 1 time in total |
|
Back to top |
|
|
johnmc Tux's lil' helper
Joined: 04 Oct 2003 Posts: 81 Location: Kansas City, MO
|
Posted: Mon Apr 12, 2004 2:04 am Post subject: |
|
|
Hmmm, I'm not sure what that means - some side-effect of safe-mode maybe? I think readdir() is in /usr/lib/php/System.php, which should be in your include_path. _________________ Pass the ribs!
----------------------------
17" G4 1.5GHZ Powerbook
Toshiba 5205-S703
----------------------------
"Survived the Dotcom crash and happily toiling for the print media again" |
|
Back to top |
|
|
kleinishere n00b
Joined: 23 Nov 2003 Posts: 37
|
Posted: Mon Apr 12, 2004 2:16 am Post subject: |
|
|
dude, i'm sorry, but i'm sorda a noob at this. i looked at the system.php and found something about readdir but it really can't help. i'm sure that not only readdir needs the absolute path, but other functions that i'll need. there has to be something i can change. i changed the include_path to what you said, and i took out the /'s in front of my requires and all of that worked. i thank you for that, but if anyone knows how to change the path so it assumes /mnt/lshare in front of everything that would be awesome! _________________ Pain is weakness leaving the body. |
|
Back to top |
|
|
stuherbert Retired Dev
Joined: 17 Aug 2003 Posts: 47 Location: Pontypridd, South Wales
|
|
Back to top |
|
|
johnmc Tux's lil' helper
Joined: 04 Oct 2003 Posts: 81 Location: Kansas City, MO
|
Posted: Mon Apr 12, 2004 12:14 pm Post subject: |
|
|
kleinishere wrote: | .. if anyone knows how to change the path so it assumes /mnt/lshare in front of everything that would be awesome! |
So, adding /mnt/lshare to your include_path directive (from the message above) didn't work? _________________ Pass the ribs!
----------------------------
17" G4 1.5GHZ Powerbook
Toshiba 5205-S703
----------------------------
"Survived the Dotcom crash and happily toiling for the print media again" |
|
Back to top |
|
|
kleinishere n00b
Joined: 23 Nov 2003 Posts: 37
|
Posted: Tue Apr 13, 2004 7:14 pm Post subject: |
|
|
yes, i added that /mnt/lshare to my include_path and it still didn't work _________________ Pain is weakness leaving the body. |
|
Back to top |
|
|
johnmc Tux's lil' helper
Joined: 04 Oct 2003 Posts: 81 Location: Kansas City, MO
|
Posted: Wed Apr 14, 2004 11:22 pm Post subject: |
|
|
Can you post your include_path line? _________________ Pass the ribs!
----------------------------
17" G4 1.5GHZ Powerbook
Toshiba 5205-S703
----------------------------
"Survived the Dotcom crash and happily toiling for the print media again" |
|
Back to top |
|
|
beandog Bodhisattva
Joined: 04 May 2003 Posts: 2072 Location: /usa/utah
|
Posted: Thu Apr 15, 2004 2:59 am Post subject: |
|
|
just gotta check ... you did restart apache after changing php.ini, right? _________________ If it ain't broke, tweak it. dvds | blurays | blog | wiki |
|
Back to top |
|
|
|