简体   繁体   English

正确设置root.php的路径变量

[英]Properly setting up path variables for root.php

I just posted a similar question, but deleted it because I realized I was working with an old file...doh! 我刚刚发布了一个类似的问题,但删除了它,因为我意识到我正在使用旧文件...哦!

I am just trying to get my XAMPP setup working for me. 我只是想让我的XAMPP设置为我工作。

I have a live site that navigates to a login page at http://www.monkeycalendar.com/arvindkt/login.php 我有一个实时网站,可浏览至http://www.monkeycalendar.com/arvindkt/login.php的登录页面http://www.monkeycalendar.com/arvindkt/login.php

That login page includes a root.php file that is found at http://www.monkeycalendar.com/arvindkt/root.php 该登录页面包含一个root.php文件,该文件位于http://www.monkeycalendar.com/arvindkt/root.php

Live site works great. 现场直播效果很好。

My localhost is set up so my sites are a folder in localhost: 我的本地主机已设置,因此我的站点是本地主机中的文件夹:

IE: http://www.example.com = localhost/example.com IE: http : //www.example.com = localhost / example.com

I'm having problems figuring out how to make my root folder point to the right directory. 我在弄清楚如何使我的根文件夹指向正确的目录时遇到问题。 Any help would be much appreciated: 任何帮助将非常感激:

root.php: root.php:

# local settings define("SITE_ROOT" , $_SERVER['DOCUMENT_ROOT']."/arvindkt"); #本地设置define(“ SITE_ROOT”,$ _SERVER ['DOCUMENT_ROOT']。“ / arvindkt”); define("SITE_URL" , " http://localhost/monkeycalendar.com "); define(“ SITE_URL”,“ http://localhost/monkeycalendar.com ”); define('DB_HOST', "localhost"); define('DB_HOST',“ localhost”); define('DB_USER', "root"); define('DB_USER',“ root”); define('DB_PASS', ""); define('DB_PASS',“”); define('DB_NAME', "dev.monkeycalendar"); define('DB_NAME',“ dev.monkeycalendar”);

如果root.php位于站点根目录中,该如何处理

define("SITE_ROOT"      ,  dirname(__FILE__));

尝试:

dirname(__FILE__)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM