首页空白 #16

Closed
opened 2021-11-11 11:02:39 +08:00 by littlegolden · 17 comments
littlegolden commented 2021-11-11 11:02:39 +08:00 (Migrated from github.com)

按照步骤填写好了 refresh_token,唯一跟教程的区别是 redirect_url 填的是 http://localhost:3000

因为 http://localhost 一直是拒绝访问,所以加了端口号,index.php 里也相应增加了 3000 端口号。

首页打开是完全空白的。控制台也没有报错

按照步骤填写好了 refresh_token,唯一跟教程的区别是 redirect_url 填的是 http://localhost:3000 因为 http://localhost 一直是拒绝访问,所以加了端口号,index.php 里也相应增加了 3000 端口号。 首页打开是完全空白的。控制台也没有报错
SomeBottle commented 2021-11-11 11:24:04 +08:00 (Migrated from github.com)

有一点需要注意,redirect_url是用于附在发给微软api的请求里的
也就是说你在Azure Portal里配置的允许的redirect_url也要带上端口,不能仅仅只改本地

如果还是不行,再试着打开一下php.ini里的报错选项,注释掉index.php的第9行error_reporting,这样按理来说是会显示报错的。接着把报错内容贴在这里即可

关于带端口的情况我尚未测试过,不知道微软那边支不支持这样

有一点需要注意,redirect_url是用于附在发给微软api的请求里的 也就是说你在Azure Portal里配置的允许的redirect_url也要带上端口,不能仅仅只改本地 如果还是不行,再试着打开一下php.ini里的报错选项,注释掉index.php的第9行error_reporting,这样按理来说是会显示报错的。接着把报错内容贴在这里即可 关于带端口的情况我尚未测试过,不知道微软那边支不支持这样
DieMoe233 commented 2021-11-11 15:36:27 +08:00 (Migrated from github.com)

Azure Application可以添加多个回调URL,你可以两个都加。

Azure Application可以添加多个回调URL,你可以两个都加。
littlegolden commented 2021-11-11 15:38:50 +08:00 (Migrated from github.com)

Azure Application可以添加多个回调URL,你可以两个都加。

但是没用。。。实在是懵了

> Azure Application可以添加多个回调URL,你可以两个都加。 但是没用。。。实在是懵了
littlegolden commented 2021-11-11 15:39:48 +08:00 (Migrated from github.com)

有一点需要注意,redirect_url是用于附在发给微软api的请求里的 也就是说你在Azure Portal里配置的允许的redirect_url也要带上端口,不能仅仅只改本地

如果还是不行,再试着打开一下php.ini里的报错选项,注释掉index.php的第9行error_reporting,这样按理来说是会显示报错的。接着把报错内容贴在这里即可

关于带端口的情况我尚未测试过,不知道微软那边支不支持这样

好的,等下测试一下

> 有一点需要注意,redirect_url是用于附在发给微软api的请求里的 也就是说你在Azure Portal里配置的允许的redirect_url也要带上端口,不能仅仅只改本地 > > 如果还是不行,再试着打开一下php.ini里的报错选项,注释掉index.php的第9行error_reporting,这样按理来说是会显示报错的。接着把报错内容贴在这里即可 > > 关于带端口的情况我尚未测试过,不知道微软那边支不支持这样 好的,等下测试一下
littlegolden commented 2021-11-11 20:16:34 +08:00 (Migrated from github.com)

伪静态写不写都一样:

首页报错:

Notice: Undefined offset: 1 in /www/wwwroot/e5.xxxx.xyz/index.php on line 463

Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220

Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220

Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220

Notice: Undefined offset: 1 in /www/wwwroot/e5.xxxx.xyz/index.php on line 463

Notice: Undefined index: file in /www/wwwroot/e5.xxxx.xyz/index.php on line 365

Notice: Trying to access array offset on value of type null in /www/wwwroot/e5.xxxx.xyz/index.php on line 365

Notice: Undefined index: file in /www/wwwroot/e5.xxxx.xyz/index.php on line 365

Notice: Trying to access array offset on value of type null in /www/wwwroot/e5.xxxx.xyz/index.php on line **365**

进入一个目录:

Notice: Undefined offset: 1 in /www/wwwroot/e5.xxxx.xyz/index.php on line 463

Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220

Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220

Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220
伪静态写不写都一样: 首页报错: ``` Notice: Undefined offset: 1 in /www/wwwroot/e5.xxxx.xyz/index.php on line 463 Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220 Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220 Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220 Notice: Undefined offset: 1 in /www/wwwroot/e5.xxxx.xyz/index.php on line 463 Notice: Undefined index: file in /www/wwwroot/e5.xxxx.xyz/index.php on line 365 Notice: Trying to access array offset on value of type null in /www/wwwroot/e5.xxxx.xyz/index.php on line 365 Notice: Undefined index: file in /www/wwwroot/e5.xxxx.xyz/index.php on line 365 Notice: Trying to access array offset on value of type null in /www/wwwroot/e5.xxxx.xyz/index.php on line **365** ``` 进入一个目录: ``` Notice: Undefined offset: 1 in /www/wwwroot/e5.xxxx.xyz/index.php on line 463 Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220 Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220 Notice: Undefined index: query in /www/wwwroot/e5.xxxx.xyz/index.php on line 220 ```
SomeBottle commented 2021-11-11 21:02:41 +08:00 (Migrated from github.com)

@littlegolden 测试了一会儿,我能复现出来同样错误了。你是不是没有把template.html放到相同目录下,或者这个文件是空的

image

@littlegolden 测试了一会儿,我能复现出来同样错误了。你是不是没有把[```template.html```](https://github.com/SomeBottle/OdIndex/blob/master/template.html)放到相同目录下,或者这个文件是空的 ![image](https://user-images.githubusercontent.com/12976469/141302571-9c8c59c8-737c-4023-835a-2dfaaf67f9cc.png)
SomeBottle commented 2021-11-11 21:03:43 +08:00 (Migrated from github.com)

没有模板文件当然是渲染不出页面的😂

没有模板文件当然是渲染不出页面的😂
littlegolden commented 2021-11-11 21:06:24 +08:00 (Migrated from github.com)

没有模板文件当然是渲染不出页面的😂

在一个页面的,首页有页面,但是目录没有,e5.itnt.xyz

> 没有模板文件当然是渲染不出页面的😂 在一个页面的,首页有页面,但是目录没有,e5.itnt.xyz
SomeBottle commented 2021-11-11 21:08:51 +08:00 (Migrated from github.com)

有没有开缓存
image
可能你之前空白页被文件缓存了
你可以手动删除文件缓存,默认是./data/cache目录

有没有开缓存 ![image](https://user-images.githubusercontent.com/12976469/141303438-2cc3fa83-99ca-49d6-9f99-c267954015c6.png) 可能你之前空白页被文件缓存了 你可以手动删除文件缓存,默认是```./data/cache```目录
littlegolden commented 2021-11-11 21:12:22 +08:00 (Migrated from github.com)

我应该没开缓存,配置就仓库默认的没有动。cache目录是空的
image

我应该没开缓存,配置就仓库默认的没有动。cache目录是空的 ![image](https://user-images.githubusercontent.com/35162802/141304346-97754862-3f53-4be2-8a48-2a815042095e.png)
SomeBottle commented 2021-11-11 21:18:07 +08:00 (Migrated from github.com)

确实不是模板问题
奇了怪了,也没看到请求上的错误,报错也都是notice级别

确实不是模板问题 奇了怪了,也没看到请求上的错误,报错也都是notice级别
SomeBottle commented 2021-11-11 21:24:09 +08:00 (Migrated from github.com)

说一下PHP版本吧,然后检查一下有没有openssl扩展
我看到主要返回的是Not Found,也就是代表后端请求返回为空。之前遇到过这个问题,可能openssl扩展的原因
启用或者禁用openssl扩展试一下。

说一下PHP版本吧,然后检查一下有没有openssl扩展 我看到主要返回的是Not Found,也就是代表后端请求返回为空。之前遇到过这个问题,可能openssl扩展的原因 启用或者禁用openssl扩展试一下。
littlegolden commented 2021-11-11 21:56:18 +08:00 (Migrated from github.com)

说一下PHP版本吧,然后检查一下有没有openssl扩展 我看到主要返回的是Not Found,也就是代表后端请求返回为空。之前遇到过这个问题,可能openssl扩展的原因 启用或者禁用openssl扩展试一下。

这么重要的事情给忘了,刚刚用的 PHP 74,换了 8.0 也有这个问题。楼主需要服务器权限看看吗

> 说一下PHP版本吧,然后检查一下有没有openssl扩展 我看到主要返回的是Not Found,也就是代表后端请求返回为空。之前遇到过这个问题,可能openssl扩展的原因 启用或者禁用openssl扩展试一下。 这么重要的事情给忘了,刚刚用的 PHP 74,换了 8.0 也有这个问题。楼主需要服务器权限看看吗
SomeBottle commented 2021-11-11 22:13:15 +08:00 (Migrated from github.com)

这么重要的事情给忘了,刚刚用的 PHP 74,换了 8.0 也有这个问题。楼主需要服务器权限看看吗

我又复现出了同样的情况,原因是:

网站服务器设置了伪静态的同时在index.php中配置了'rewrite'=>false

刚刚看了一下你的站点,有可能是这个问题了

你可以在index.php相关配置改成'rewrite'=>true试试
亦可以暂时撤去网站服务器的伪静态设置

> 这么重要的事情给忘了,刚刚用的 PHP 74,换了 8.0 也有这个问题。楼主需要服务器权限看看吗 我又复现出了同样的情况,原因是: 在**网站服务器设置了伪静态**的同时**在index.php中配置了```'rewrite'=>false```** 刚刚看了一下你的站点,有可能是这个问题了 你可以在index.php相关配置改成```'rewrite'=>true```试试 亦可以暂时撤去网站服务器的伪静态设置
SomeBottle commented 2021-11-11 22:21:04 +08:00 (Migrated from github.com)

还是不行的话,我可以去层主的服务器上调试检查一下,隐私信息可以通过邮件发给我😂
邮箱就是我的Github账户邮箱

还是不行的话,我可以去层主的服务器上调试检查一下,隐私信息可以通过邮件发给我😂 邮箱就是我的Github账户邮箱
SomeBottle commented 2021-11-11 23:57:38 +08:00 (Migrated from github.com)

问题解决:

  1. 要展示onedrive根目录内容时要设置base => '' (这里是我默认配置写错了,很抱歉(ノへ ̄、)
  2. 340行左右判断空目录用的是isset,已改为array_key_exists方法

感谢各位的协助排查!

问题解决: 1. 要展示onedrive**根目录**内容时要设置```base => ''``` (这里是我默认配置写错了,很抱歉(ノへ ̄、) 2. 340行左右判断空目录用的是```isset```,已改为```array_key_exists```方法 感谢各位的协助排查!
littlegolden commented 2021-11-11 23:58:34 +08:00 (Migrated from github.com)

大赞!辛苦了

大赞!辛苦了
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: SomeBottle/OdIndex#16
No description provided.