pear and pecl print hundreds of E_STRICT deprecation lines on PHP 8.4
Deprecated: Constant E_STRICT is deprecated in pearcmd.php on line 441Short answer
PHP 8.4 deprecated the E_STRICT constant because the error level was removed. Old PEAR still uses it, so every pear or pecl command prints warnings from pearcmd.php. The fix is a newer PEAR: version 1.10.16 and later stop referencing E_STRICT on PHP 8.4.
Fix it fast
1Find out which cause you have
Check the PEAR version. Anything below 1.10.16 prints these lines on PHP 8.4.
pear version2Match what you see, then jump to its fix
What does the error look like?
Deprecated: Constant E_STRICT is deprecated in pearcmd.php on line 441
Cause 1 of 2
PEAR is older than 1.10.16
1Check
PEAR 1.10.16 includes the change that never references E_STRICT on PHP 8.4 and later.
pear version2Fix
Upgrade PEAR itself.
pear upgrade PEAR3Verify
The version is 1.10.16 or higher and pecl list is clean.
pear version
pecl listConfirmed by github.com
Cause 2 of 2
The upgrade fails silently on Homebrew
1Check
The PEAR issue tracker reports that on Homebrew the upgrade can fail silently until the version is forced and ownership of the Homebrew Cellar folder is fixed.
pear version2Fix
Force the upgrade. If the version still does not change, fix ownership of the PHP folder in your Homebrew Cellar for your user and run it again.
pear upgrade --force PEAR3Verify
pear version shows 1.10.16 or higher.
pear versionConfirmed by github.com
How do I stop it coming back?
- Check pear version after every PHP minor upgrade.
- Pin the PEAR version in Docker builds that run pecl install, and rebuild images after a PHP minor upgrade.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Android gets HTML instead of JSON from a PHP API
org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
The response body is not JSON.
2 causes, each with a fixBack end
Apache returns 403 when a URL contains %3F
a request like /page%3Fname=test is refused while /page?name=test works
Recent Apache httpd blocks a rewrite when the request contains an encoded question mark (%3F) and the rewritten target has a literal ?.
2 causes, each with a fixBack end
Apache returns 500 with Premature end of script headers
500 Internal Server Error
Apache ran your script, but the script printed no valid HTTP header before its output.
3 causes, each with a fixBack end
Apache returns 503 or 504 because PHP-FPM did not answer in time
Error dispatching request
Apache sent the request to PHP-FPM and gave up waiting.
3 causes, each with a fixBack end
AWS SDK for PHP cannot get credentials from the instance profile metadata server
Error retrieving credentials from the instance profile metadata server.
The SDK tries the EC2 instance metadata service when it has no valid credentials from anywhere earlier in its chain.
4 causes, each with a fixBack end
AWS SDK for PHP rejects requests: the signature is from the future
Signature not yet current: {date} is still later than {date}
AWS compares the timestamp in your signed request with its own clock.
2 causes, each with a fix