Page 1 of 1
Not magic quotes, but slashes are being added on live server
Posted: Sat Jun 20, 2009 2:09 am
by jaoudestudios
For some reason the same code on my production server is getting slashes added, but magic quotes are off on dev and live.
Any ideas what it could be?
Re: Not magic quotes, but slashes are being added on live server
Posted: Sat Jun 20, 2009 5:42 am
by terier
Try to have a look if for some reason magic quotes gets enabled "locally" instead of server-wide.
Re: Not magic quotes, but slashes are being added on live server
Posted: Sat Jun 20, 2009 1:03 pm
by jaoudestudios
Nope, looks fine.
Plus it works fine on my dev server (the exact same code) which is pretty much the same - but obviously a small difference, just cant figure out what it is
Does anything else control addslashes?
Re: Not magic quotes, but slashes are being added on live server
Posted: Sat Jun 20, 2009 1:30 pm
by Eran
Run this just before you run the code that is under suspicion to make sure:
Code: Select all
var_dump( get_magic_quotes_runtime() );
var_dump( get_magic_quotes_gpc() );
Re: Not magic quotes, but slashes are being added on live server
Posted: Sun Jun 21, 2009 2:02 am
by jaoudestudios
pytrin wrote:Run this just before you run the code that is under suspicion to make sure:
Code: Select all
var_dump( get_magic_quotes_runtime() );
var_dump( get_magic_quotes_gpc() );
Thank you pytrin, we now have a clue, but not sure what it means.
On my dev server I get...
int(0) int(0)
But on live I get...
int(0) int(1)
So var_dump( get_magic_quotes_gpc() ); is returning true. I am using Zend Framework.
What does this mean?
Re: Not magic quotes, but slashes are being added on live server
Posted: Sun Jun 21, 2009 2:36 am
by Eran
It means that magic_quotes is on, either via the php.ini or via .htaccess. find it and destroy it
Re: Not magic quotes, but slashes are being added on live server
Posted: Sun Jun 21, 2009 12:34 pm
by jaoudestudios
I just cant find it. Nothing in php.ini or .htaccess files
The only difference between my 2 servers is that my live server is using plesk.
Re: Not magic quotes, but slashes are being added on live server
Posted: Sun Jun 21, 2009 3:31 pm
by Eran
is using plesk
yikes. I guess this is shared hosting? or do you have a VPS?
many server configuration have several .ini files for PHP that extend the original .ini file. It's possible one of those adds the magic_quotes directive. You might want to grep for it
Re: Not magic quotes, but slashes are being added on live server
Posted: Sun Jun 21, 2009 11:33 pm
by jaoudestudios
pytrin wrote:is using plesk
yikes. I guess this is shared hosting? or do you have a VPS?
Nope its a dedicated box.
pytrin wrote:is using plesk
many server configuration have several .ini files for PHP that extend the original .ini file. It's possible one of those adds the magic_quotes directive. You might want to grep for it
Yep I did a grep already to check all the additional *.ini files, but still nothing.
Could it be a mysql setting?
Re: Not magic quotes, but slashes are being added on live server
Posted: Sun Jun 21, 2009 11:41 pm
by jaoudestudios
My next dedicated will be pure linux and no plesk.

Re: Not magic quotes, but slashes are being added on live server
Posted: Tue Jun 23, 2009 3:19 am
by jaoudestudios
I could not find the little s**t!
I have just turned off magic quotes in the .htaccess file - probably best as it wont give me issues server to server.
Re: Not magic quotes, but slashes are being added on live server
Posted: Tue Jun 23, 2009 4:24 am
by VladSun
Have you tried:

Re: Not magic quotes, but slashes are being added on live server
Posted: Tue Jun 23, 2009 7:36 am
by jaoudestudios
I did, but it took too long so stopped it.
But I should leave it running to find out where the issue is.