Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Magic quotes warning at install


Reply


8 Posts   3843 Views

Avatar
theoldlr

Community Member, 103 Posts

25 March 2011 at 3:06am

I have seen this before and always ignored it without any problems, but today I got curious... The warning:

Titled: magic_quotes_gpc option turned off
Description:
magic_quotes_gpc is set to '1' in php.ini. This should be turned off, as it can cause issues with cookies. More specifically, unserializing data stored in cookies.

In my .htaccess file I tried each of the following:

php_value magic_quotes_gpc 1
php_value magic_quotes_gpc 0
php_value magic_quotes_gpc off

Each time the Description of the warning changed to reflect what value I had set, but it never went away. Is this cause I edited .htaccess and not php.ini? This is a pretty silly error message :-) :

magic_quotes_gpc is set to 'off' in php.ini. This should be turned off, as it can cause issues with cookies. More specifically, unserializing data stored in cookies.

Thanks!

Avatar
Velocy

Community Member, 3 Posts

25 March 2011 at 12:12pm

Actually... are you allowing to override the configuration in the httpd.conf via AllowOverride?

Avatar
tchintchie

Community Member, 63 Posts

28 April 2011 at 4:53am

I get the same warning even if i set the magic_quotes_gpc to Off! It just won´t disappear. Is there a solution or can I just proceed with the install ignoring that warning?

Avatar
tchintchie

Community Member, 63 Posts

28 April 2011 at 5:11am

aaah so simple it´s almost embarassing.... since I´m using MAMP PRO I found the solution here http://forum.mamp.info/viewtopic.php?f=2&t=6770 that fixed the final warning and I could install SS with "green lights" for the first time :-)

so if anyone using MAMP discovered the same warning at install check out the above link!

Avatar
JMagnusson

Community Member, 29 Posts

14 October 2011 at 9:42pm

I have the same problem, but not on MAMP but on a hosted server. It says: magic_quotes_gpc is set to 'off' in php.ini. This should be turned off...

Hove someone solved this?
How can i check if magic_quotes_gpc really is checked off? I dont know so much about these things...

Thanks,
Johan Magnusson

Avatar
martimiz

Forum Moderator, 1132 Posts

15 October 2011 at 5:29am

I think it might have something to do with the way ini_get() interpretes php settings. If set to 'Off' within php.ini, ini_get() will return an emty string, and that's what the SS install script is checking on (Install.php, around line 386).

It seems that if you set magic_quotes_gpc to 'Off' (or false or 0) anywhere else, ini_get() might retrieve the 'real' value. And as 'Off' is not an empty string, the install check will fail. So if it says 'Off' in the warning, just go ahead and install, I guess...

Avatar
JMagnusson

Community Member, 29 Posts

15 October 2011 at 5:59am

Wow, thanks!

Is there a way to check if it really is set to Off? Not the way that install is doing, but the right way?
As said, I don't know so much about these things.

/Johan Magnusson

Avatar
martimiz

Forum Moderator, 1132 Posts

15 October 2011 at 7:24am

I think you can always phpinfo() would tell you. You likely know this, but just in case: create a php file in the site root like this:

<?php
phpinfo();

I suppose it'll pick up .htaccess settings as well. Not the ones you make in SilverStripe configs though...