Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

pear and pecl print hundreds of E_STRICT deprecation lines on PHP 8.4

ErrorDeprecated: Constant E_STRICT is deprecated in pearcmd.php on line 441

Short 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.

  • Applies to PHP 8.4, PEAR 1.10.16
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check the PEAR version. Anything below 1.10.16 prints these lines on PHP 8.4.

    pear version
  2. 2Match what you see, then jump to its fix

    1. 1pear version prints 1.10.15 or lowerPEAR is older than 1.10.16Fix
    2. 2pear upgrade PEAR prints nothing useful and pear version does not changeThe upgrade fails silently on HomebrewFix

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 version

2Fix

Upgrade PEAR itself.

pear upgrade PEAR

3Verify

The version is 1.10.16 or higher and pecl list is clean.

pear version
pecl list

Confirmed by github.com

Did this fix it?

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 version

2Fix

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 PEAR

3Verify

pear version shows 1.10.16 or higher.

pear version

Confirmed by github.com

Did this fix it?

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

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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.