frankelot
frankelot

Reputation: 14409

Getting "Deprecated: ini_set()" on a fresh Homestead vagrant VM

I'm getting this 'weird' error on a homestead vm

Deprecated: ini_set(): Use of mbstring.http_output is deprecated

I did some research but couldn't find anything helpful here's some info about my enviroment

php -v 5.6.0

And here's the complete error, just in case

enter image description here

Upvotes: 1

Views: 5881

Answers (3)

Vlad Alivanov
Vlad Alivanov

Reputation: 1234

For UTF-8 settings I use this

if (version_compare(PHP_VERSION, '5.6.0') < 0) {
    ini_set('mbstring.internal_encoding', 'UTF-8');
    ini_set('mbstring.http_input', 'auto');
    ini_set('mbstring.http_output', 'UTF-8');
}
ini_set('mbstring.language', 'Neutral');
ini_set('mbstring.encoding_translation', 'On');
ini_set('mbstring.detect_order', 'auto');
ini_set('mbstring.substitute_character', 'none');
ini_set('default_charset', 'UTF-8');

Upvotes: 2

dpluscc
dpluscc

Reputation: 600

Incase someone else stumbles across this, I resolved this with the following:

To note, the app I'm trying to run on php 5.6.14 is built using Laravel 4.0.

I added the following to my composer.json's required:

"patchwork/utf8": "~1.1"

Then I ran 'composer update patchwork/utf8'

I also had to update the app/config/session.php cookie variable to something other than laravel_session as the newer site was causing a session error.. So - I basically changed 'cookie'=>'laravel_session' to 'cookie'=>'laravel_session_4'.

composer dump-autoload and the world was spinning correctly again.

Hope this helps!

Upvotes: 7

Mike
Mike

Reputation: 24383

mbstring.http_output was deprecated as of PHP 5.6. PHP 5.6 and later users should leave this empty and set default_charset instead. (See http://php.net/manual/en/mbstring.configuration.php).

Upvotes: 2

Related Questions