Forum Moderators: coopster
If I build a site on my home machine, it means changing:
[pre]
require("/var/www/site.com/includes/setup.inc");[/pre] I thought maybe I could inlude a file from the http root that just used ini_set('include_path', 'path/to/includes'); and then I'd only have one file to edit before uploading.
I can't spot any security issues but, am wary of putting such stuff in the public_html/ without first checking to see what you guys think ;)
Thoughts?
Nick
Your ini_set() approach looks OK to me at first glance, though I would probably feel more comfortable with the idea if the directory it was set to were outside of the web space.
You have to be sure that files ending in .inc are parsed. Why not call your file something.php - that way you know it'll be parsed.
You could try using a file called setup.php with all of the data in it that relates to where files are etc. and including it at the top of every page where you need it. Then when you upload to server you only need to change that 1 file.
You could try using a file called setup.php with all of the data in it that relates to where files are etc. and including it at the top of every page where you need it. Then when you upload to server you only need to change that 1 file.
Yes, that's exactly what I do. In this case though, I would have to change the include call to that file on every page when I upload.
Setting the include_path in something.php sorts that out.
Thanks all....
Nick
What I do is setup php.ini on:
server 1:
include_path="/path/to/include"; and on include_path="/other/path/to/include"; Then a file that contains:
include ("site/file.php"); Hope this helps.