I am using php-qrcode-detector-decoder for reading QR codes in photos. It works on most servers, PHP 7.3 - 8.3.
But on some other servers I get errors and I can not figure out why. Even with the same PHP version.
It seems that the ones that work are cPanel hosted and the ones that don't are not, at least so far.
The error is:
PHP Fatal error: Uncaught Error: Object of class GdImage could not be converted to string in /path/to/GDLuminanceSource.php:54
Line 54 is:
$this->$gdImage = $gdImage;
Comes from:
public function GDLuminanceSource($gdImage, $width, $height){ parent::__construct($width, $height); $this->dataWidth = $width; $this->dataHeight = $height; $this->left = 0; $this->top = 0; $this->$gdImage = $gdImage;
Any insight on why it works in one environment and not another?
I've tried changing $this->$gdImage = $gdImage; to $this->gdImage = $gdImage; but makes it not work on the working servers.