Nextcloud停留无限登录页面 PHP7的问题及解决方案

升级了新的PHP7.3,安装方法 https://www.itgeeker.net/php7-3-yum-install-on-centos-7/

Nextcloud 14或者15 无法打开登录界面

出现错误信息如下:

内部服务器错误
服务器不能完成你的请求。

如果再次发生,请在下方将技术详情发送给服务器管理员。

更多细节可以在服务器日志中找到.

技术细节
远程地址: 210.22.126.186
请求 ID: kSPvbdWDU7yvwng3516v

请求的ID会不断改变,查询logo也没有太多有用的信息。基本是php session权限的问题,解决方案:

vi /etc/php-fpm.d/www.conf 
#如果是remi yum 安装的php7.3路径/etc/opt/remi/php73/php-fpm.d/www.conf

#根据你的客户端替换
user = apache
group = apache
#为nginx,如果你使用的nginx前端
user = nginx
group = nginx
#更改session目录权限并重启
chown -R root:nginx /var/lib/php/session/
systemctl restart php-fpm
#若无效,试试
chmod -R 777 /var/lib/php/session

Nextcloud 14或者15永远停留在登录界面

输入正确的用户名和密码,点击登入后清空两个字段,还是停留在登录界面。

看看Nextcloud在Github上的issue部分的留言吧:

Arnros commented on 12 Nov 2018
yes it seems to come from php 7.2.
I just upgraded my version of php 7.0 to 7.2 from remi repo and found myself looping on the login page.
EDIT: I tried with php7.1 from remi repo and same problem.
EDIT2: I tried with php7.0 from “webtatic” repo and it’s work.
EDIT3: I installed php 7.2 from webtatic and it’s work ! I have only problem with remi php.

https://github.com/nextcloud/server/issues/11149

里面没提到remi php7.3同样有这个问题,ITGeeker技术奇客建议你安装webtatic的php7.2吧,因为它可以工作,当然我试了一下装php7.0也可以工作,但当你升级到Nextcloud 15之后会在管理员面板提示你的PHP版本不够新。

如何使用yum安装webtatic的php7.2@CentOS 7

官方参考页面:https://webtatic.com/packages/php72/

首先添加源:

#CentOS/RHEL 7.x:
yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

安装你想要的php7.2模块 for Nextcloud

yum --enablerepo=webtatic install mod_php72w php72w-opcache php72w-fpm

yum --enablerepo=webtatic install php72w-pear php72w-bcmath php72w-mysqlnd php72w-gd php72w-common php72w-fpm php72w-intl php72w-cli php72w php72w-xml php72w-opcache php72w-pecl-apcu php72w-pecl-jsond php72w-pdo php72w-gmp php72w-process php72w-pecl-imagick php72w-devel php72w-mbstring php72w-zip php72w-ldap php72w-imap php72w-pecl-mcrypt

启动php并添加自动启动

systemctl restart php-fpm
systemctl enable php-fpm

The current PHP memory limit is below the recommended value of 512MB

vi /etc/php.ini
memory_limit = 512M

无法打开登录界面

确认使用的是Apache还是Nginx,修改vi /etc/php-fpm.d/www.conf

user = apache
group = apache
#替换为
user = nginx
group = nginx
#再更新一下权限
chown -R root:nginx /var/lib/php/session/

问题解决了,Nextcloud 15顺利登录啦。

webtatic的php7.2和remi的php7.2安装候选了比较,前者的比较完善,也不用ls链接php执行命令,配置文件也在比较通用的目录。


评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

奇客罗方公众号 奇客罗方小程序 奇客罗方客服 ITGeeker Telegram

网站由ITGeeker技术奇客开发并管理;隶属于GeekerCloud奇客罗方智能科技
Site designed and developed by ITGeekerwhich is a sub-website of GeekerCloud
网站地图 | 沪ICP备2021031434号-4