-
Notifications
You must be signed in to change notification settings - Fork 7.8k
ArgumentCountError Thrown When Using openssl_public_encrypt and Other OpenSSL Functions #18387
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
Comments
Can you try upgrading to PHP 8.1.32? Is this not available in Ubuntu 22.04 yet? |
@alperenuzun Could you also clarify whether you're using JIT or any 3rd party extensions? |
My apologies for the mistake; my PHP version is actually 8.1.2. Below is the JIT output:
Additionally, here are the enabled modules:
I haven't attempted to upgrade to a newer PHP version yet. This is because the error is difficult to reproduce using a local image, and upgrading PHP in our production environment also presents challenges. Therefore, I would prefer to exhaust all troubleshooting steps with the current version first. Considering this situation, do you believe upgrading is likely to fix the issue and is it a worthwhile step to consider despite the difficulty? |
8.1.2 is over 3 years old at this point. Chances are that this issue is already fixed, and thus any investigation to find the cause would be a waste of time. Hence, please upgrade first. It would also be worth trying to disable the JIT (not PCRE JIT), as it can sometimes lead to issues (especially given how old this version is). |
Description
After migrating from Amazon Linux 2 to Ubuntu 22.04 — and upgrading OpenSSL from version 1.0.2 to 3.0.2 — I have encountered two recurring types of errors:
1. OpenSSL Encryption Method Errors (ArgumentCountError)
When calling the
openssl_public_encrypt
function, it seems the method signature has changed, resulting in errors such as:Other methods also show similar inconsistencies:
While this may indicate changes in method signatures or internal validation logic, it's still unclear why different ArgumentCountError messages are thrown for the same method.
2. cURL Errors
This error occurs intermittently, particularly during peak request times.
Error Frequency: 10–20 times per day (Not always)
OpenSSL Version: 3.0.9
Questions
Any insights or suggestions would be greatly appreciated.
Best regards,
PHP Version
PHP 8.1.31 (cli) (built: Nov 21 2024 13:10:15) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.31, Copyright (c) Zend Technologies
with Zend OPcache v8.1.31, Copyright (c), by Zend Technologies
Operating System
Ubuntu 22.04
The text was updated successfully, but these errors were encountered: