Skip to content
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

部署时报错,Response.php有错 #1784

Closed
H4nke2 opened this issue Jul 5, 2024 · 5 comments
Closed

部署时报错,Response.php有错 #1784

H4nke2 opened this issue Jul 5, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@H4nke2
Copy link

H4nke2 commented Jul 5, 2024

描述这个 Bug

lnmp部署,php可以正常解析phpinfo.php,但是访问index.php或者install.php时nginx报错:FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected 'Response'(T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /usr/share/nginx/html/var/Typecho/Response.php on line 73" while reading response header from upstream,

复现方式

复现的步骤:

安装nginx,php,并配置好,启动服务。
打开index.php

期望的结果

能够正常进入安装页面

截图

image

@H4nke2 H4nke2 added the bug Something isn't working label Jul 5, 2024
@joyqi
Copy link
Member

joyqi commented Jul 5, 2024

你的 Typecho 版本和 PHP 版本分别是?

@H4nke2
Copy link
Author

H4nke2 commented Jul 5, 2024

你的 Typecho 版本和 PHP 版本分别是?

typecho是1.2.1换了开发版也不行,php是7.2.24

@cuixiping
Copy link

既然提示了 /usr/share/nginx/html/var/Typecho/Response.php on line 73,看了一下这个文件的第73行,内容是:

private static Response $instance;

显然,这种类型声明方法,php 7.2.24 不支持,升到 php 8.0 或更高吧,建议升最新的。

@H4nke2 H4nke2 closed this as completed Jul 8, 2024
@sy-records
Copy link
Member

1.2.1 应该是没问题的,开发版本已经要求PHP7.4了

@cuixiping
Copy link

1.2.1 应该是没问题的,开发版本已经要求PHP7.4了

他这个提示 PHP Parse error: syntax error, unexpected 'Response'(T_STRING) 这就不是1.2.1的代码, 1.2.1 的这行没有类型声明的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants