PDA

View Full Version : PHP include_dir


mgy333
05-02-2001, 01:04 PM
I am very new to PHP.

Can some one tell me how to set up "include_dir"? Or do we even have access to do that?

I have a Windows version of PHP with Apache on my machine, in which case, "include_dir" can be set in the file called php.ini.

If I don't have access to change "include_dir", then what is the default value?

Thanks.

petesmc
05-02-2001, 01:16 PM
The default value is in the directory that you are trying to include from.

Although to change it create a .htaccess file and inside enter:

php include_path /home/username/public_html/folder/

that should work correctly,

-Peter

Maurice
05-02-2001, 05:35 PM
...good answer as always, Peter -- you almost always have good answers -- but one thing: where would that .htaccess file be stored? Would it have to be in every directory from which I would want to include? :confused:

petesmc
05-02-2001, 05:40 PM
Hi,

Either stick it in the root directory or in public_html and thats all!

-Peter

Maurice
05-02-2001, 05:48 PM
Actually, that's what I thought after posting my question... But as usual, you're a great help, Peter.

mgy333
05-02-2001, 11:05 PM
Pete, I tried as you told me. I made a .htaccess file at /public_html/ directory. In it, I have line as you told me. But I get the following error on error log, and server throws 500.

[Wed May 2 19:09:39 2001] [alert] [client 208.59.249.9] /home/lvtkd/public_html/.htaccess: Invalid command 'php', perhaps mis-spelled or defined by a module not included in the server configuration

Any idea on what's going on?

Also, I half gave up on it, and made copy of the files to be included in the same directory as the PHP file. The include still didn't work. Why not?????

Thanks in advance!! Please help!

~Motoo

sylow
05-03-2001, 07:02 AM
replace php with php_value in your .htaccess file

mgy333
05-03-2001, 09:05 AM
Thanks Peter and Sylow!

It works!!!

The last bit of problem that I was having (the files weren't included even when I placed them in the same directory) was my own fault. I had a slash ("/") in front of each included file names. Ooops.

~Motoo