PHP die() function suddenly stops showing message string

Viewed 36

I have upgraded my server Ubuntu version, and with it, PHP to 8.1.

After finishing all that stuff, I noticed that PHP die() function is not working properly:

Example 1 -> die("Lorem ipsum"); // not showing anything at all

Example 2 -> echo "Lorem"; die("Ipsum"); // showing "Lorem"

In my local apache it works fine, I don't know where to look.

Things I tried:

  • Turning error_reporting to ALL.
  • Checking flushing values at php.ini.
  • Do manual flush.
  • Tried directly with CLI using "php -a" command enter image description here

Do you have any idea what can I look for?

1 Answers

After a thorough analysis, I have discovered where the issue came from. I uninstalled all PHP packages at one server, and then started installing them one by one while testing output.

It seems that the problem was being caused by a package: php8.1-uopz

After installing all again, but that packag the bug dissapeared.

So, in all other servers, just running

sudo apt autoremove php8.1-uopz

Fixed the issue.

Related