[PHP] Magic Quotes GPC

IntactDev

Member
Nov 22, 2012
399
71
Hello; I have a PHP script that is throwing an error that I've googled everywhere, tried a few solutions, but none seemed to work for me. Here is the error:

Array ( [type] => 8192 [message] => Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater [file] => Unknown [line] => 0 )

I have never seen this error, and I am unsure how to solve it.
 

IntactDev

Member
Nov 22, 2012
399
71
Open up those 10+ files and do a global Ctrl+F on 'magic_quotes_gpc' and paste a chunk from each match.
Searching 93 files for "magic_quotes_gpc"
0 matches across 0 files

I made this framework a year or two ago, and I never remembered using magic_quotes. I don't even know what that is.

EDIT
------------
The error appears when submitting the form:
 

IntactDev

Member
Nov 22, 2012
399
71
rofl l2 grep

turn off magic quotes in your php.ini
I've already tried that; unfortunately it didn't work.
; This directive is deprecated. Use variables_order instead.
gpc_order = "GPC"

; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
;magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
;magic_quotes_sybase = Off
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456
Add this to your .htaccess
php_flag magic_quotes_gpc Off

And if you are able to edit your php.ini, there sure should be a function to reboot Apache.
 

Ecko

23:37 [autobots] -!- eckostylez [[email protected]]
Nov 25, 2012
1,397
961
Just submitted a ticket, thanks.

Not sure, so my answer would be no?
sorry meant php as suphp.

add this to your htaccess:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/username
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>

change this part suPHP_ConfigPath /home/username - to the path of your php.ini file
 

IntactDev

Member
Nov 22, 2012
399
71
sorry meant php as suphp.

add this to your htaccess:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/username
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>

change this part suPHP_ConfigPath /home/username - to the path of your php.ini file
I don't know the path to the php.ini file; would I just change the "username" field to my cPanel username?
 

Users who are viewing this thread

Top