脚本的基目录
我正在制作 twitter 应用程序,当我调用callback.php 时它显示一些错误 这是我的callback.php的一部分,我认为它有一些问题
////// First establish base directory for app
define('QA_BASE_DIR', dirname(empty($_SERVER['SCRIPT_FILENAME']) ? __FILE__ : $_SERVER['SCRIPT_FILENAME']).'/../../');
$qainc=$_SERVER['DOCUMENT_ROOT'] . '/qa-include'; //second
$piinc=$_SERVER['DOCUMENT_ROOT'] . '/qa-plugin';
/* Start session and load lib */
session_start();
require_once $piinc. '/twitter-oauth-login/twitteroauth/twitteroauth.php';
require_once $piinc. '/twitter-oauth-login/config.php';
,我想要我的目录url,所以我写第二行 www.domain.com/qa-plugin ----- 我想要这个网址,但这个命令返回这个地址 “/usr/local/apache/htdocs/qa-include” 如何纠正错误请帮我......
i am making twitter application when i call callback.php it shows some error
here is some part of my callback.php where i think it has some problem
////// First establish base directory for app
define('QA_BASE_DIR', dirname(empty($_SERVER['SCRIPT_FILENAME']) ? __FILE__ : $_SERVER['SCRIPT_FILENAME']).'/../../');
$qainc=$_SERVER['DOCUMENT_ROOT'] . '/qa-include'; //second
$piinc=$_SERVER['DOCUMENT_ROOT'] . '/qa-plugin';
/* Start session and load lib */
session_start();
require_once $piinc. '/twitter-oauth-login/twitteroauth/twitteroauth.php';
require_once $piinc. '/twitter-oauth-login/config.php';
i want my directory url so i write second line
www.domain.com/qa-plugin ----- i want this url but this command return this address
"/usr/local/apache/htdocs/qa-include"
how to correct error please help me out....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更多信息
More info
请参阅
$_SERVER['HTTP_HOST']
更详细的 http: //php.net/manual/en/reserved.variables.server.php
See
$_SERVER['HTTP_HOST']
More verbose http://php.net/manual/en/reserved.variables.server.php
将
$_SERVER['DOCUMENT_ROOT']
更改为$_SERVER['SERVER_NAME']
Change
$_SERVER['DOCUMENT_ROOT']
to$_SERVER['SERVER_NAME']