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_ht
ml/en/head
er.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_htm
l"
but this give me the following error message:
Warning: main(): Failed opening '/England/header.php' for inclusion (include_path='home/hotelh
ea/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/p
ath" ); to your php scripts."
The example that he put in my .htaccess file was:
php_value include_path .:/path/global/includes:/p
ath/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_ht
ml/en/head
er.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