View Full Version : PHP config file?
pepsi_max2k
11-02-2007, 06:39 AM
Hi, I've been suggested I should add the following code to my php config file to have it work site-wide...
<?php
define("DOC_ROOT", "/home/username/public_html");
?>
Problem is, I don't know where the config file should be :o The cirtex site suggests php.ini for php5, but as I'm using php4 could I just stick it in .htaccess somehow? Or can I create a php.ini file anywhere and it be recognized?
Thanks.
ps. i know i could use $server document_root, but there's a good reason i need define and use the above instead.
Hi, the .htaccess should work for you:
php_value doc_root "/home/username/public_html"
http://support.cirtex.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=23
pepsi_max2k
11-02-2007, 08:11 AM
hmm... doesn't seem to work for me, not sure if i'm doing stuff wrong or if the method's wrong...
I need it to use with php include code on loads of other pages. it works fine when the original define("DOC_ROOT"... bit is added in the page with the following:
<?php
include DOC_ROOT . '/crimea/pages/header.php';
?>
but following what you said and sticking the php_value doc_root... bit in .htaccess (both in root and folder) doesn't seem to do anything. using doc_root or DOC_ROOT in both bits of code doesn't change it either. this is what i've got in my page with the php include code now:
Warning: main(doc_root/crimea/pages/header.php) [function.main]: failed to open stream: No such file or directory in /home/inaueco/public_html/crimea/pages/downloads.html on line 3
http://www.immortalsoon.co.uk/pages/downloads.html
obviously the doc_root variable just isn't being recognized by it atm.
EDIT: how am i meant to call the php_value doc_root from other code? if it's just meant to alter $_SERVER['DOCUMENT_ROOT'] then that's no use (and if it was, it still doesn't help me...). i just need to create a new variable to use instead of the default document root.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.