
Error “PHP Startup: session.sid_length INI setting is deprecated” (SOLVED)
February 13, 2025
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
Related articles:
- PHP Warning: PHP Startup: imap: Unable to initialize module (SOLVED). How to install the imap module for PHP on Arch Linux (97.6%)
- How to install and use pikaur and makepkg on a server (88.8%)
- phpMyAdmin error “Error: Undefined constant "SODIUM_CRYPTO_SECRETBOX_KEYBYTES"” (SOLVED) (85.4%)
- Error “cannot resolve dependency lib32 (32-bit library)” (SOLVED) (81.1%)
- “Error: failed to commit transaction (invalid or corrupted package)” (SOLVED) (81.1%)
- PHP regular expressions don't work with very long strings (SOLVED) (RANDOM - 71.4%)