@gmail dot com Posted October 21, 2008 Share Posted October 21, 2008 Hi guys I am new and also stuck in this problem $HTTP_SERVER_VARS['DOCUMENT_ROOT'] ... i want to edit my website local server here the actual config file <?php $DIR_PATH = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . "/"; $WWW_PATH = "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . "/"; $LIB_PATH = $DIR_PATH . 'aplib/'; $INC_PATH = $DIR_PATH . 'inc/'; $IMG_PATH = $WWW_PATH . 'images/'; $CSS_PATH = $WWW_PATH . 'css/'; $JS_PATH = $WWW_PATH . 'js/'; $CONFIRMATION_PATH = $WWW_PATH . 'confirmation/'; ?> and here the modified config content , because i need to edit the website in a local server <?php $DIR_PATH = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . "/"; $WWW_PATH = "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . "/"; $LIB_PATH = $DIR_PATH . 'localhost/www/leolle/aplib/'; $INC_PATH = $DIR_PATH . 'localhost/www/leolle/inc/'; $IMG_PATH = $DIR_PATH . 'localhost/www/leolle/images/'; $CSS_PATH = $DIR_PATH . 'localhost/www/leolle/css/'; $JS_PATH = $DIR_PATH . 'localhost/www/leolle/js/'; $CONFIRMATION_PATH = $DIR_PATH . 'localhost/www/leolle/confirmation/'; ?> here the view script in index file (calling all the content in config.php) <?php session_start(); include "config.php"; include $LIB_PATH . "functions.php"; include $LIB_PATH . "hft_image.php"; include $LIB_PATH . "phpMysqlConnection.php"; $sql = new phpMysqlConnection($user,$pass,$host); $sql->SelectDB($db); include $INC_PATH . "header_inc.php"; ?> i already set the register global= On , and already import the sql data base(works fine when i import it via phpMyAdmin) then when i try to execute the index.php the problem begain .... ??? Warning: include(/localhost/www/leolle/aplib/db.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\wamp\www\leolle\config.php on line 67 Warning: include() [function.include]: Failed opening '/localhost/www/leolle/aplib/phpMysqlConnection.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\wamp\www\leolle\index.php on line 6 this just a view waring (total i receive 8 error ). so my question is whay the local server fail to read the config path ??? , i will so happy if you guys correct my script so i able to execute it in local server thanks guys steven Link to comment https://forums.phpfreaks.com/topic/129393-problem-with-http_server_varsdocument_root/ Share on other sites More sharing options...
discomatt Posted October 21, 2008 Share Posted October 21, 2008 <?php $DIR_PATH = $HTTP_SERVER_VARS['DOCUMENT_ROOT'] . "/leolle/"; $WWW_PATH = "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . "/"; $LIB_PATH = $DIR_PATH . 'aplib/'; $INC_PATH = $DIR_PATH . 'inc/'; $IMG_PATH = $WWW_PATH . 'images/'; $CSS_PATH = $WWW_PATH . 'css/'; $JS_PATH = $WWW_PATH . 'js/'; $CONFIRMATION_PATH = $WWW_PATH . 'confirmation/'; ?> Link to comment https://forums.phpfreaks.com/topic/129393-problem-with-http_server_varsdocument_root/#findComment-670868 Share on other sites More sharing options...
@gmail dot com Posted October 22, 2008 Author Share Posted October 22, 2008 I already try it $DIR_PATH = $_SERVER['DOCUMENT_ROOT'] . "/leolle/"; $WWW_PATH = "http://" . $_SERVER['SERVER_NAME'] . "/"; or $DIR_PATH = $_SERVER['DOCUMENT_ROOT'] . "/leolle/"; $WWW_PATH = "http://" . $_SERVER['SERVER_NAME'] . "/"; , still face with the same issue .... any other suggestion ? and also about $WWW_PATH = "http://" . $_SERVER['SERVER_NAME'] . "/"; this is refer in local computer as local host right . cheers Link to comment https://forums.phpfreaks.com/topic/129393-problem-with-http_server_varsdocument_root/#findComment-671382 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.