Not magic quotes, but slashes are being added on live server
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Not magic quotes, but slashes are being added on live server
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?
Any ideas what it could be?
Re: Not magic quotes, but slashes are being added on live server
Try to have a look if for some reason magic quotes gets enabled "locally" instead of server-wide.
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Not magic quotes, but slashes are being added on live server
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?
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
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() );- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Not magic quotes, but slashes are being added on live server
Thank you pytrin, we now have a clue, but not sure what it means.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() );
On my dev server I get...
But on live I get...int(0) int(0)
So var_dump( get_magic_quotes_gpc() ); is returning true. I am using Zend Framework.int(0) int(1)
What does this mean?
Re: Not magic quotes, but slashes are being added on live server
It means that magic_quotes is on, either via the php.ini or via .htaccess. find it and destroy it
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Not magic quotes, but slashes are being added on live server
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.
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
yikes. I guess this is shared hosting? or do you have a VPS?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
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Not magic quotes, but slashes are being added on live server
Nope its a dedicated box.pytrin wrote:yikes. I guess this is shared hosting? or do you have a VPS?is using plesk
Yep I did a grep already to check all the additional *.ini files, but still nothing.pytrin wrote: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 itis using plesk
Could it be a mysql setting?
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Not magic quotes, but slashes are being added on live server
My next dedicated will be pure linux and no plesk. 
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Not magic quotes, but slashes are being added on live server
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.
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
Have you tried:

Code: Select all
# grep -R magic_quotes /There are 10 types of people in this world, those who understand binary and those who don't
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Not magic quotes, but slashes are being added on live server
I did, but it took too long so stopped it.
But I should leave it running to find out where the issue is.
But I should leave it running to find out where the issue is.