修复 php 应用程序的路径问题

修复 php 应用程序的路径问题

我已经安装了 a2billing。问题是它只显示空白页。这是 apache 日志:

[Sun Oct 23 17:51:17 2016] [error] [clientIP ADDRESS] PHP Warning:  include(../lib/admin.defines.php): failed to open stream: No such file or directory in /var/www/html/a2billing/admin/Public/index.php on line 34
[Sun Oct 23 17:51:17 2016] [error] [client IP ADDRESS] PHP Warning:  include(): Failed opening '../lib/admin.defines.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/a2billing/admin/Public/index.php on line 34

以下是index.php的代码:

//LICENSE HERE

include '../lib/admin.defines.php';
include '../lib/admin.smarty.php';

getpost_ifset(array (
    'error'
));

$smarty -> assign("error", $error);
$smarty -> display('index.tpl');

从这里可以看出错误。lib 目录的位置如下:

/var/www/html/a2billing/common/lib

index.php 文件的位置如下:

/var/www/html/a2billig/admin/Public/index.php

如果我复制 /var/www/html/a2billing/admin 中的 lib 目录和其他几个目录,错误就会消失,一切都会正常工作,我设法找到的另一个解决方案是将完整路径放在 include 语句中。但是,我在使用这些解决方案时遇到了问题。对于第一个解决方案,软件说我已经更改了版权协议和他们的名称等。我可以购买一些许可证,他们会允许我这样做。第二个解决方案的问题在于,我只能显示登录页面,没有其他内容。服务器有 php 5.3、apache 2.2.15 和 centos 6.6

除了购买许可证外,还有什么办法可以解决这个问题。

答案1

尝试:

include $_SERVER["DOCUMENT_ROOT"].'common/lib/admin.defines.php'

另外,检查应用程序的权限是否为 775,确保所有者和组是 apache

相关内容