mikelbring / tinyissue

Simple Issue Tracking for Teams
MIT License
769 stars 204 forks source link

Error : Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater #142

Closed patrickroux closed 3 years ago

patrickroux commented 11 years ago

I have this error with 5.3.16 PHP version.

Unhandled Exception

Message:

Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater Location:

Unknown on line 0

soalhn commented 11 years ago

Be sure to disable (comment out or delete) the following directives from php.ini and/or .htaccess: magic_quotes_gpc, magic_quotes_runtime, magic_quotes_sybase

patrickroux commented 11 years ago

I did, trying all solutions given to me on the web. Turned out, every "solution" threw me either an internal error, or the same message. I also even tried to disable the use of magicquotes into the code.

By the way, prefixing tbale names do not work, each try I spent 10min cleaning up my db. Anyway, that is another issue.

soalhn commented 11 years ago

But which PHP file gives you the error about magic quotes?

patrickroux commented 11 years ago

/app/laravel/hash.php on line 1

soalhn commented 11 years ago

Which OS do you have and did you install PHP from the official repositories?

patrickroux commented 11 years ago

Actually I'm not on local, but on mutualized hoting (OVH)

soalhn commented 11 years ago

So I think it's the problem with this hosting. The most probable thing is that you only have access to local php.ini/.htaccess and magic quotes directives lies on a global php.ini - and that's the reason you have the error message. You should contact OVH administrators and they should help you.

patrickroux commented 11 years ago

Hi, Thank you for your answer. After further research I found a solution. Simply add the following at the beginning of the htaccess :

SetEnv PHP_VER 5_3 SetEnv MAGIC_QUOTES 0 SetEnv REGISTER_GLOBALS 0

You should consider putting it by default in the project or correcting the magicquote thing, because making mandatory to have PHP5.3 with an app using something deprecated like MagicQuotes is a bit tricky :)

By the way, I should also insist on prefixing database tables.

rickydeez commented 11 years ago

Still having this error - it should really get fixed..

ghost commented 10 years ago

I fixed this by adding

ini_set('magic_quotes_gpc', 0);

to the top of index.php

benedettogit commented 9 years ago

My magic_quotes are definitely off, but i still get the error message, and I've also tried all the ways from this post and others, but no one works. Any body has updates on this?

tomerof commented 9 years ago

I'm working with laravel 5 on php 5.6 with apache 2.4 and got this error. sometimes it show it and sometimes it doesn't. didn't find a solution yet.