Advertisement

10.15.2005 at 02:00AM PDT, ID: 21596027
[x]
Attachment Details

putting the include_path function in .htaccess is giving me a 500 error message!

Asked by Liz_Danaher in PHP Installation

Tags: include_path, php_value, htaccess

Hi,

I hope someone can help me - this seems like it should be a really simple problem but I've been having trouble trying to solve it all week.

I want all includes in my php site to be site root relative and therefore look like this (where "en" is a top level folder on my local site):

include ("/en/header.php");

However, at the moment they only work if I enter this:

include ("/home/hotelhea/public_html/en/header.php");

I obviously don't want to enter the whole /home/hotelhea/public_html bit for every include on the site. So after some research I discovered I'd need to change my include_path on my php.ini file. However, my host won't give me access to this as they say it would mess up other stuff on the server.

So then I read I could set include_path in my .htaccess file, so I entered the following into .htaccess:

php_value include_path "/home/hotelhea/public_html"

but this give me the following error message:

Warning: main(): Failed opening '/England/header.php' for inclusion (include_path='home/hotelhea/public_html') in /home/hotelhea/public_html/resources/africa/1.php on line 20

At one stage I was also getting a 500 error message so I wrote to my host who said:

"This is now working however it apperes that you did not have the full command
line in your .htaccess file. i have enterd an example that you need to edit with
the correct values. however this will only work on servers with phpexec
disabled. if you requite this to work on a server with phpexec then you need to
add ini_set ( "include_path","your/new/path" );  to your php scripts."

The example that he put in my .htaccess file was:

php_value include_path .:/path/global/includes:/path/local/includes

but I seem to have tried every combination of path and can't get anything to work. I wish he'd just told me exactly what to write!

So, to summarise, this works:

include ("/home/hotelhea/public_html/en/header.php");

...but this doesn't:

include ("/en/header.php");

...and in case it's relevant, all my files locally are saved in:

C:\Documents and Settings\Liz_Danaher\My Documents\Liz's Stuff\Hotel Heaven\public_html

Please, please, please could someone explain to me in very basic language what I need to do. I'm a desperate woman!!!

Thanks very much for reading, and hopefully hear from someone soon!

Yours,

Liz
Start Free Trial
[+][-]10.15.2005 at 06:54PM PDT, ID: 15093086

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10.17.2005 at 01:15PM PDT, ID: 15102701

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.18.2005 at 01:54AM PDT, ID: 15105634

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.18.2005 at 01:28PM PDT, ID: 15111177

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.18.2005 at 01:38PM PDT, ID: 15111261

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Installation
Tags: include_path, php_value, htaccess
Sign Up Now!
Solution Provided By: ahoffmann
Participating Experts: 3
Solution Grade: B
 
 
[+][-]10.18.2005 at 01:52PM PDT, ID: 15111374

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.23.2005 at 11:00AM PDT, ID: 15141932

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.23.2005 at 01:43PM PDT, ID: 15142368

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32