Loading...
X

Error “PHP Startup: session.sid_length INI setting is deprecated” (SOLVED)

After upgrading to PHP 8.4, you may have encountered the following error:

PHP Deprecated:  PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0

Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
PHP Deprecated:  PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0

Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0

The gist of the error is that the user-defined value of the two variables mentioned has been deprecated.

How to fix the error “Deprecated: PHP Startup: session.sid_length INI setting is deprecated”

To fix this error, open the php.ini file:

sudo gedit /etc/php/php.ini

Find and comment out the line

session.sid_length =

You can also delete this line altogether.

Then find and comment out or delete the line

session.sid_bits_per_character =

That's it – save and close the php.ini file.

Now this error with the mention of session.sid_length and session.sid_bits_per_character is gone:

php -v

Arch Linux and its derivatives have a file /etc/php/php.ini.pacnew – this is the new configuration file for PHP 8.4. By default, your old configuration file is saved, and the new one is saved with the extension .pacnew. If you want, you can replace the file /etc/php/php.ini with the new file php.ini.pacnew, but this will erase all your custom settings that you made in php.ini!

For details on the deprecated values ​​session.use_only_cookies, session.use_trans_sid, session.trans_sid_tags, session.trans_sid_hosts, and session.referer_check in PHP 8.4, please see this link: https://www.php.net/manual/en/migration84.deprecated.php

You can also find additional information on the issue at hand here: https://www.drupal.org/node/3469305


Leave Your Observation

Your email address will not be published. Required fields are marked *