Getting PHP Deprevation Warnings During Upgrade with CLI

I want to know if it’s a known issue or if it’s just me.

When upgrading to 8.4.2 I’m getting PHP deprecation warnings when running the commands to upgrade.

$ php -v
PHP 8.1.25 (cli) (built: Oct 27 2023 11:17:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.25, Copyright (c) Zend Technologies
with the ionCube PHP Loader v12.0.3, Copyright (c) 2002-2022, by ionCube Ltd.
with Zend OPcache v8.1.25, Copyright (c), by Zend Technologies

In php.ini,

Put below line.

error_reporting=E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED

That change didn’t work, still getting this.

./bin/console
PHP Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php on line 134
PHP Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php on line 144
PHP Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Session::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/http-foundation/Session/Session.php on line 131
PHP Deprecated: Return type of Symfony\Component\HttpFoundation\Session\Session::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/http-foundation/Session/Session.php on line 141
PHP Deprecated: Return type of Symfony\Component\HttpFoundation\ParameterBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/http-foundation/ParameterBag.php on line 210
PHP Deprecated: Return type of Symfony\Component\HttpFoundation\ParameterBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/http-foundation/ParameterBag.php on line 220
PHP Deprecated: Return type of Symfony\Component\HttpFoundation\HeaderBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/http-foundation/HeaderBag.php on line 255
PHP Deprecated: Return type of Symfony\Component\HttpFoundation\HeaderBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/http-foundation/HeaderBag.php on line 265
PHP Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/mydomain.net/subdomains/crm/vendor/symfony/console/Helper/HelperSet.php on line 94
Symfony 5.2.14 (env: prod, debug: false)

Quick Repair and Rebuild

Admin → Repair → Quick Repair and Rebuild

Also didn’t work.

I guess I’ll put up with it and just wait for SuiteCRM to update to Symfony 6.

Did you remember to restart your web server?

Also, make sure you’re editing the correct php.ini, often there is more than one and people edit the wrong one.

You can go in Admin / Diagnostics / phpinfo and check which php.ini you’re using, and to check the effective values that are configured.

It matters where you are running PHP from. If you run it from command line, it uses the cli/php.ini and apache2/php.ini when run through apache.

You are executing phpinfo() through the browser, hence you get /etc/php8.1/apache2/php.ini as the answer. Running

php -r “phpinfo();” | grep “Loaded Configuration”

from the terminal should output the CLI ini. Same function, context changes.

The advantage of this system is obviously to allow different configurations depending on the context. For a simplified example, you might want to have safe_mode on in apache but it’s unnecessary in CLI mode.

edit; the php.ini configuration is loaded fresh each time you invoke PHP from the CLI.

Thanks, we’re using Plesk which allows for easy individual PHP customization per subdomain, which separate of the CLI. I set the variables in the global php.ini and local settings and do not get any change.

I’m not worry about it, I’m sure it’ll be fixed in the future.