WebFaction
Community site: login faq

To set properly the document root when multiple webapps resides under the same websites, according to http://docs.webfaction.com/software/php.html#setting-php-s-document-root we need to:

1- Create a file that will set properly $_SERVER['DOCUMENT_ROOT'] (set_document_root.php)
2- Add the auto_prepend_file directive in php.ini

Question: Do we need also to modify $_ENV['DOCUMENT_ROOT'] ?

asked 29 Jul '12, 13:15

Boozezela
123
accept rate: 0%

edited 30 Jul '12, 02:13


The settings are independent. If you also need $_ENV['DOCUMENT_ROOT'], add to the set_document_root.php file like this:

<?php
  $_SERVER['DOCUMENT_ROOT'] = '/home/username/webapps/example_application';
  $_ENV['DOCUMENT_ROOT'] = '/home/username/webapps/example_application';
?>
permanent link

answered 29 Jul '12, 14:37

timg ♦♦
1.3k4
accept rate: 30%

For completeness, if you're actually trying to change the document root where the application is served, then you might be better served using a Symbolic Link to Static/CGI/PHP application. This is described in this related community post.

permanent link

answered 08 Mar '14, 09:25

ryans ♦♦
5.0k93360
accept rate: 43%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×6

question asked: 29 Jul '12, 13:15

question was seen: 9,654 times

last updated: 08 Mar '14, 09:25

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM