-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问是否支持php8?百度贴吧云签到 V5.00 (PHP 8.2.7) 在工作时发生致命的异常 消息:#0 - Undefined constant "EMAIL" #255
Comments
我在用 PHP8.2,没法复现问题。 常量 Tieba-Cloud-Sign/lib/globals.php Line 55 in 4822472
|
我是未登录状态,我看了前面的代码并测试了,第一层if就没进去: Tieba-Cloud-Sign/lib/globals.php Line 11 in 4822472
而貌似setcookie是在进去之后才设置的? |
理论上鉴权都没过不应该会调用到 Tieba-Cloud-Sign/lib/globals.php Lines 282 to 286 in 4822472
所以我不太能理解为什么会出现这个问题 |
debug半天还是不懂,目前确定的是走了login分支,template("login")加载了,但是不知道为什么又跳转到template("index")了 Tieba-Cloud-Sign/lib/globals.php Line 254 in 4822472
|
有任何进展吗?我这里这个环境还是存在这个问题 |
崩溃了, 今天重装了vps的系统, 从debian到ubuntu 22.04, php从8.2到8.1, 依旧报一样的错 百度贴吧云签到 V5.00 (PHP 8.1.2-1ubuntu2.14) 在工作时发生致命的异常 @ 2024-03-17 22:20:05消息:#0 - Undefined constant "EMAIL" 文件 | 行 | 代码 -- | -- | -- /var/www/tieba/lib/sfc.functions.php | 178 | [抛出异常] /var/www/tieba/templates/index.php | 14 | getGravatar /var/www/tieba/lib/ui.php | 95 | include /var/www/tieba/templates/control.php | 96 | template /var/www/tieba/lib/ui.php | 95 | include /var/www/tieba/index.php | 14 | template |
你是什么系统?难道是cpu的问题?我vps是arm64的cpu |
我原本用的是cloudflare zero trust的tunnel进行访问,刚刚尝试了直接通过ip访问,也是一样的报错,git clone的最新的代码,数据库删了重建的 |
从代码逻辑看是不可能报这个错的,希望有人解惑 |
发 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
/etc/mysql/conf.d/mysql.cnf: [mysql]
[mysqld]
innodb_buffer_pool_size=12G
secure_file_priv=""
bind-address=127.0.0.1 |
相关的日志: mariadb在安装的第4步,也就是填写数据库相关信息之后,会有个报错,但是实际上安装提示成功了,查看数据库里,表也都创建了 nginx/error.log有报错 nginx/access.log:
nginx/error.log:
php log:
mariadb log:
MariaDB [tiebacloud]> show tables;
+----------------------+
| Tables_in_tiebacloud |
+----------------------+
| tc_baiduid |
| tc_cron |
| tc_options |
| tc_plugins |
| tc_tieba |
| tc_users |
| tc_users_options |
+----------------------+
7 rows in set (0.000 sec) |
大脑升级php83,请 https://launchpad.net/~ondrej/+archive/ubuntu/php
$ grep -rP '<\?(?!php|=)'
grep: source/doc/baiduid.png: binary file matches
grep: source/fonts/captcha.ttf: binary file matches
grep: source/fonts/glyphicons-halflings-regular.woff: binary file matches
grep: source/fonts/glyphicons-halflings-regular.woff2: binary file matches
source/fonts/glyphicons-halflings-regular.svg:<?xml version="1.0" standalone="no
grep: source/fonts/glyphicons-halflings-regular.eot: binary file matches
建议设置
关,请 |
[PHP Modules]
amqp
apcu
ast
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ds
enchant
exif
FFI
fileinfo
filter
ftp
gd
gearman
gettext
gmp
gnupg
hash
http
iconv
igbinary
imagick
imap
intl
json
ldap
libxml
mbstring
memcache
memcached
mongodb
msgpack
mysqli
mysqlnd
OAuth
odbc
openssl
pcntl
pcov
pcre
PDO
pdo_dblib
PDO_Firebird
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
ps
pspell
psr
raphf
readline
redis
Reflection
rrd
session
shmop
SimpleXML
snmp
soap
sockets
sodium
solr
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
uopz
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib 为什么要装这么多? |
为什么改默认的
您内存很少吗? server {
listen 127.0.0.1:8881;
- listen [::1}:8881;
+ listen [::1]:8881;
- location / {
- root /var/www/tieba;
+ root /var/www/tieba;
- index index.html index.htm index.php;
+ index index.php index.html;
- }
- location ~ \.php$ {
+ # https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/
+ location ~ [^/]\.php(/|$) {
- root /var/www/tieba;
+ fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+
+ # https://serverfault.com/questions/627903/is-the-php-option-cgi-fix-pathinfo-really-dangerous-with-nginx-php-fpm
+ if (!-f $request_filename) {
+ return 404;
+ }
+ try_files $uri =404;
+
+ # Mitigate https://httpoxy.org/ vulnerabilities
+ fastcgi_param HTTP_PROXY "";
+
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
- # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
- # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
+ # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#use-request-filename-for-script-filename
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ # https://serverfault.com/questions/465607/nginx-document-rootfastcgi-script-name-vs-request-filename
+ # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
} |
为什么? https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_secure_file_priv 用完了 |
Tieba-Cloud-Sign/lib/class.mysqli.php Line 119 in 09ca411
Line 25 in 09ca411
Line 17 in 09ca411
Line 17 in 09ca411
Lines 48 to 53 in 09ca411
Line 10 in 09ca411
所以 config.php 在那一瞬是空文件(文件不存在require 会报E_COMPILE_ERROR )?
Tieba-Cloud-Sign/setup/install.php Line 183 in 09ca411
Tieba-Cloud-Sign/lib/mysql_autoload.php Line 25 in 09ca411
Tieba-Cloud-Sign/lib/class.S.php Line 8 in 09ca411
|
8.3会可用吗( |
怕万一用到什么的,就装了一堆( |
因为有一个[www],一共2个php套接字( 我看注释貌似ondemand更合理一些?空闲的时候就杀死进程 nginx好复杂( |
我记得这项是因为好久之前在网上看到,这一项设置为空可以阻止sql写文件,提高安全性(原来现在为空是无效的了,要写NULL |
所以这报错是正常的? |
我就在用
建议全部卸载只装tc用到的
那为什么不用默认的
但启动新phpfpm进程慢,
您不在乎安全性也大可直接无脑一行
5.7也是一样的 https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_secure_file_priv 估计是分不清
否
|
thanks, 已解决 |
把 |
问题描述
升级debian版本到12后,php-fpm版本从7.4升级到了php8,升级之前是能正常用的,升级之后访问首页报错,看了README.md和issue,没找到关于版本的讨论,自己debug了一下,没搞明白
/var/www/tieba/lib/sfc.functions.php
/var/www/tieba/templates/index.php
/var/www/tieba/lib/ui.php
/var/www/tieba/templates/control.php
/var/www/tieba/lib/ui.php
/var/www/tieba/index.php
复现步骤
使用php-fpm8搭建,访问首页
我看
lib/globals.php
定义EMAIL时,是在有cookie有登录信息的时候才会调用,而报错点是访问首页返回头像的时候调用了这个变量,即使改成不用EMAIL,其他地方又会报错ISVIP未定义,应该确实是版本问题?这样的话是否只能用docker来快速解决这个问题?环境
Linux server0 5.10.0-25-arm64 #1 SMP Debian 5.10.191-1 (2023-08-16) aarch64 GNU/Linux
debian12.2mysql Ver 15.1 Distrib 10.11.5-MariaDB, for debian-linux-gnu (aarch64) using EditLine wrapper
The text was updated successfully, but these errors were encountered: