WebFaction
Community site: login faq

I am trying to disable PHP's magic quotes, eg...

if(get_magic_quotes_gpc()) die('magic_quotes_gpc needs to be off');

They are kind of a development nightmare for me today. I am assuming all of the software I have on my server will be fine with the disabling, but won't know until I try.

Apparently they are none too popular (http://en.wikipedia.org/wiki/Magic_quotes) and removed from 5.4.

I am using 5.3 on this site via a directive in the .htaccess file:

Action php53-cgi /php53.cgi AddHandler php53-cgi .php

The method below is said to be preferred, but it is not taking. The PHP docs (http://www.php.net/manual/en/security.magicquotes.disabling.php) say use php_flag but a commenter recommended trying php_value. Anyway, neither seem to be taking with this WF account.

<IfModule php5_module>
php_flag magic_quotes_gpc off 
php_value magic_quotes_gpc off
</IfModule>

The docs say this cannot be changed at runtime, so that would rule out any software I am running turning it on before getting to my code of the day. Thanks.

asked 28 Sep '11, 17:21

Mick
1811
accept rate: 0%

PS: The post preview was ignoring line breaks. But it came out ok after posting. Someone might want to look into that.

(28 Sep '11, 17:22) Mick

Are you checking with a phpinfo page? When I check mine by default they are all off,

magic_quotes_gpc    Off Off
magic_quotes_runtime    Off Off
magic_quotes_sybase Off Off
permanent link

answered 28 Sep '11, 17:53

johns
5.3k312
accept rate: 23%

I have magic_quotes_gpc ON in phpinfo. It's not something I've ever turned on for any reason in my life. So I don't think that would explain the situation.

Like I say, the action handler bit...

Action php53-cgi /php53.cgi AddHandler php53-cgi .php

Goes to a cgi under my home directory... one pre-installed. I'm not sure how it is configured. But prior to 5.4 it is on by default.

FYI: I use "php_value auto_prepend_file" in the same .htaccess file/IfModule block, which I am pretty sure must be in effect because I don't think the site in question would work if not.

(28 Sep '11, 18:30) Mick

Please submit a support ticket so we can see the account in real-time. The phpinfo page I used is on a blank php53 app I only have the phpinfo file in for testing, so it is the 'default' AFAIK. This would indicate something else is happening and we would need to take a look.

(28 Sep '11, 18:53) johns
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×3
×2

question asked: 28 Sep '11, 17:21

question was seen: 7,119 times

last updated: 28 Sep '11, 18:53

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM