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

Unexpected die when there is a PHP startup error. #1192

Closed
phith0n opened this issue May 10, 2020 · 3 comments · Fixed by #1195
Closed

Unexpected die when there is a PHP startup error. #1192

phith0n opened this issue May 10, 2020 · 3 comments · Fixed by #1195

Comments

@phith0n
Copy link

phith0n commented May 10, 2020

As I know, PHP startup error will not affect the normal application. But when I use selfoss in a virtual host service(I am not able to modify the PHP.INI), an unexpected error is thrown:

Fatal error: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so (libMagickWand.so.5: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory))

Because there is a startup error checker in the Fatfree framework: f3-factory/fatfree-core#125, the application will be exit when a start error exists.

You can disable the checker error_reporting(0) to solve this problem.

@jtojnar
Copy link
Member

jtojnar commented May 10, 2020

Ugh, I really hate it when F3 does “smart” things like this without a sensible way to disable the behaviour.

Fortunately, if I am parsing the code correctly, there should be no code path that has the error handler set up and error reporting disabled so just plopping error_reporting(0) before the following should be fine:

https://github.com/SSilence/selfoss/blob/defe8424991468c416e19243469cb7ce87b22d51/src/common.php#L18

@phith0n
Copy link
Author

phith0n commented May 14, 2020

Yep

jtojnar added a commit that referenced this issue May 15, 2020
F3 crashes when there were PHP startups error even though
they might not affect the program (e.g. unable to load an extension).
It also sets its own error_reporting value and uses the previous one
as a signal to disable the initialization failure check.

Let's use that to avoid the crash and log the error ourselves.

Fixes: #1192
@jtojnar
Copy link
Member

jtojnar commented May 15, 2020

I opened a PR with a fix: #1195

jtojnar added a commit that referenced this issue May 17, 2020
F3 crashes when there were PHP startups error even though
they might not affect the program (e.g. unable to load an extension).
It also sets its own error_reporting value and uses the previous one
as a signal to disable the initialization failure check.

Let's use that to avoid the crash and log the error ourselves.

Fixes: #1192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants