Closed Saad-Ramzan-Kiani closed 3 weeks ago
Hi @Saad-Ramzan-Kiani what version are you using to the composer.lock file on your server?
"require": { "php": "^8.2", "endroid/qr-code": "^5.0.7",
@Saad-Ramzan-Kiani this is the requirement, what does your lock file say? Also, please look at the Builder.php file on the server and let me know what it shows.
my composer.lock file: ""name": "endroid/qr-code", "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/endroid/qr-code.git", "reference": "0cc00f0626b73bc71a1ea17af01387d0ac75e046" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/endroid/qr-code/zipball/0cc00f0626b73bc71a1ea17af01387d0ac75e046", "reference": "0cc00f0626b73bc71a1ea17af01387d0ac75e046", "shasum": "" }, "require": { "bacon/bacon-qr-code": "^2.0.5", "php": "^8.1" }, "conflict": { "khanamiryan/qrcode-detector-decoder": "^1.0.6" }, "require-dev": { "endroid/quality": "dev-main", "ext-gd": "*", "khanamiryan/qrcode-detector-decoder": "^1.0.4||^2.0.2", "setasign/fpdf": "^1.8.2" }, "suggest": { "ext-gd": "Enables you to write PNG images", "khanamiryan/qrcode-detector-decoder": "Enables you to use the image validator", "roave/security-advisories": "Makes sure package versions with known security issues are not installed", "setasign/fpdf": "Enables you to use the PDF writer" }, "type": "library", "extra": { "branch-alias": { "dev-main": "5.x-dev" } }, "autoload": { "psr-4": { "Endroid\QrCode\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Jeroen van den Enden", "email": "info@endroid.nl" } ], "description": "Endroid QR Code", "homepage": "https://github.com/endroid/qr-code", "keywords": [ "code", "endroid", "php", "qr", "qrcode" ], "support": { "issues": "https://github.com/endroid/qr-code/issues", "source": "https://github.com/endroid/qr-code/tree/5.0.7" }, "funding": [ { "url": "https://github.com/endroid", "type": "github" } ], "time": "2024-03-08T11:24:40+00:00" },"
Your lock looks fine, that version should have the create method
In other words, the remote server seems to have a different version than the one according to your lock file. Please check what methods your live server's Builder.php.
Make sure to check on the live server, not locally of course ;)
For version: 6.0.0, what method is used in place of create() to generate a new QR code?
In 6.x you can simply use the constructor, see https://github.com/endroid/qr-code/blob/master/README.md
to update to latest version :"endroid/qr-code": "^6.0.1", code: " composer update endroid/qr-code --with-all-dependencies "
Please mention it in README.md file.
I updated to the latest version, then revised my method, and now it's working perfectly.
Hi @Saad-Ramzan-Kiani good to see you found the cause, good luck!
I'm trying to make Qr Code of links provided by user,
Method: if (isset($validatedData['Permit_link'])) {
its working perfectly on localhost but on liver server, its displaying me this error: "Internal Server Error: Call to undefined method Endroid\QrCode\Builder\Builder::create() "