You are here: Re: Determining document root when $_SERVER['DOCUMENT_ROOT'] is not an option « PHP Programming Language « IT news, forums, messages
Re: Determining document root when $_SERVER['DOCUMENT_ROOT'] is not an option

Posted by Alvaro G. Vicario on 06/26/07 21:04

*** laredotornado@zipmail.com escribió/wrote (Tue, 26 Jun 2007 12:55:15
-0700):
> We're using PHP 4.4.4 with Apache 2 on Linux. Aggravatingly, the
> hosting company has done something to where $_SERVER['DOCUMENT_ROOT']
> no longer returns the path to the web root directory. I have now gone
> through all my code and replaced $_SERVER['DOCUMENT_ROOT'] with a
> constant, DOC_ROOT. Now, the challenge is to define the constant.
>
> Suggestions?

If you have your own php.ini file (many ISPs offer this possibility), then
you can fill the DOCUMENT_ROOT variable to suit your needs:

::: php.ini :::

auto_prepend_file = /home/foo/phpconfig.php


::: phpconfig.php :::

<?php

$_SERVER['DOCUMENT_ROOT'] = '/home/foo/whatever';

?>



--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация