Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include on test server vs. include on production server 1

Status
Not open for further replies.

MikeBronner

Programmer
Joined
May 9, 2001
Messages
756
Location
US
Hi all,

I have a little conuncrum I can't quite figure out how to solve. My dilema is that I have a test server with a different tree structure than my production server. Also, my test server is Apache 1.3.29 running on WinXP, while my production server is Apache 1.3.29 running on Linux.

Both are running on PHP and MySQL.

I am using a template system with my pages, so I have a common header for all pages, where I have the following line:
Code:
ini_set("include_path",".:/home/bronnerm/public_html/ramtek/includes");

Now this works fine on my production server, but on my test server the include directory is located at C:/AppServ/ Naturally when I move stuff to the test server, things don't work anymore, since it can't find the includes.

So far the only way I have been able to solve this, was to include both the test server include folder and the production server include folder in the include directive, like this:
Code:
ini_set("include_path",".:/home/bronnerm/public_html/ramtek/includes;C:/AppServ/www/ramtek/includes");

Wouldn't this be a potential security risk? Aside from that, is there a way to configure the test server to redirect from /home/bronnerm/public_html/ramtek/includes automatically to C:/AppServ/
Thanks for all your help!

Mike
 
Unfortunately, there is no good way to make the server map one directory to another.

If your test server were running Linux, you might be able to do a symbolic link in the right place, but on XP that's not an option.

Also, there is nothing you can do in Apache, as PHP's include is independent of any directory mapping that Apache can take.

Instead of using ini_set() to set up the include path, why not just edit php.ini?

Want the best answers? Ask the best questions: TANSTAAFL!!
 
If I do that, won't my ini_set() that is used for the production server override the settings in php.ini? Unfortunately I can't alter the php.ini on the production server.

Thanks for your help! :)

Take Care,
Mike
 
ini_set() will override the values. But you're using Apache -- you can also set the PHP include path in httpd.conf and in a .htaccess file.

My first advice, though, would be to try relative paths in your include() invocations.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Good ideas. Thanks for all your help! :)

Take Care,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top