【发布时间】:2018-09-16 18:57:13
【问题描述】:
我有一个网站,我试图在我的 LAMP 服务器上离线运行,但是当我尝试使用 localhost 或本地 IP 地址进入它时,页面是空白的。
如果我打开检查器,我可以看到所有元素,如果我将鼠标悬停在检查器中的某个元素上,我可以看到它们在页面中的位置,但它们是不可见的。
我检查了 apache 日志文件并看到了那个错误(换行以获得更舒适的视图):
[:error] [pid 3180] [client 127.0.0.1:60802] PHP Fatal error: require_once():
Failed opening required '/var/www/html' (include_path='.:/usr/share/php') in
/var/www/html/cache/cache.php on line 572
然后我在 google 上搜索了解决方案,找到了 this 指南,但没有设法解决问题。
很乐意得到帮助。
编辑:
这是ls -la的输出:
total 12
drwxr-xr-x 3 root root 4096 אפר 6 11:53 .
drwxr-xr-x 15 root root 4096 אפר 6 11:53 ..
drwxrws--- 16 localhost www-data 4096 אפר 6 14:36 html
我设法通过更改此处的opacity 使页面可见:
<?=($config['environment']!=='dev')?'style="opacity:0;"':''?>
对此:
<?=($config['environment']!=='dev')?'style="opacity:1;"':''?>
现在我可以看到该页面,但由于某种原因 CSS 没有加载。
我也得到了很多:
SQL/DB Error -- [Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'sitename_site.pv.name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by]
编辑 #2:
更改/var/www 的权限后,这是我得到的错误:
Fatal error: Uncaught exception 'RuntimeException' with message 'The file could not be written to. Check that appropriate permissions have been set.' in /var/www/html/vendor/katzgrau/klogger/src/Logger.php:128 Stack trace: #0 /var/www/html/includes/db_class.php(7204): Katzgrau\KLogger\Logger->__construct('/var/www/html/i...') #1 /var/www/html/includes/db_class.php(7217): db_class->getLogger('404') #2 /var/www/html/includes/furl_router.php(55): db_class->logger('404') #3 /var/www/html/includes/furl_router.php(229): goTo404('no page-data / ...') #4 /var/www/html/index.php(17): require_once('/var/www/html/i...') #5 {main} thrown in /var/www/html/vendor/katzgrau/klogger/src/Logger.php on line 128
【问题讨论】:
-
我假设你的 css/images/js 没有加载。
-
@RolandStarke 为什么假设它?
-
"打开失败需要'/var/www/html'"这可能是一个目录,而不是一个文件。你不能
require_once()一个目录。 -
@Omer 因为你说所有元素都在那里,只是缺少样式。你能检查一下网络标签吗?
-
我用过
include_once