UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Web Hosting and Domains > PHP Hosting

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 30-01-2008, 23:02
Junior Member
 
Join Date: Jul 2007
Posts: 28
Question Turn Off magic_quotes

Hi all,

I'm trying to get TinyMCE working with php, but have hit a snag. There seams to be a problem with magic_quotes, see here

Is it possible to switch off magic_quotes with the .htaccess file?

Thanks Stu
Reply With Quote
  #2 (permalink)  
Old 30-01-2008, 23:35
Rock's Avatar
System Administrator
 
Join Date: Dec 2006
Posts: 521
Thumbs up

You can use any one of these...
Quote:
php_flag magic_quotes_gpc off
php_value magic_quotes_gpc 0
__________________

Rock _a.k.a._ Jack L.

http://www.eUKhost.com
Windows Hosting || Windows Reseller Hosting
Reply With Quote
  #3 (permalink)  
Old 31-01-2008, 08:41
mephisto's Avatar
Member
 
Join Date: Feb 2007
Location: Darlington
Posts: 99
Send a message via ICQ to mephisto Send a message via MSN to mephisto
Default

A page on how to disable them.

http://uk3.php.net/manual/en/securit....disabling.php

Which version of php are you using? In php 5 they are disabled by default, php 6 is not even going to support them.

If you're using php 4, then you should consider updating to 5 as 4 is only getting critical updates now, and will be fully dropped on 08/08/2008.
Reply With Quote
  #4 (permalink)  
Old 31-01-2008, 20:50
Junior Member
 
Join Date: Jul 2007
Posts: 28
Unhappy

Quote:
Originally Posted by mephisto View Post
Which version of php are you using? In php 5 they are disabled by default, php 6 is not even going to support them.
Our reseller package uses php 5, but phpinfo() says magic_quotes_gpc On

Quote:
php_flag magic_quotes_gpc off
php_value magic_quotes_gpc 0
I've tried both of these and get the following in the error log.

Invalid command 'php_value', perhaps mis-spelled or defined by a module not included in the server configuration
Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration


Any ideas?
Reply With Quote
  #5 (permalink)  
Old 01-02-2008, 07:40
mephisto's Avatar
Member
 
Join Date: Feb 2007
Location: Darlington
Posts: 99
Send a message via ICQ to mephisto Send a message via MSN to mephisto
Default

Have you got access to php.ini? If so then change these in the file to

Code:
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
Unfortunatly you can't disable these at runtime using ini_set.

If php is being ran under fast-cgi instead of an apache module, then the .htaccess commands won't work. You'll be able to tell if it is fast-cgi if there aren't any apache sections in phpinfo.
Reply With Quote
  #6 (permalink)  
Old 01-02-2008, 14:52
Junior Member
 
Join Date: Jul 2007
Posts: 28
Default

We have a Linux Standard reseller package http://www.eukhost.com/reseller-hosting.php
So I don't think I can change it.
Reply With Quote
  #7 (permalink)  
Old 01-02-2008, 15:44
flesso's Avatar
Premium Member
 
Join Date: Mar 2007
Location: 127.0.0.1
Posts: 1,137
Send a message via MSN to flesso Send a message via Skype™ to flesso
Default

This can be done with the use of .htaccess and a custom php.ini file.

First, create or modify the .htaccess file in the root of your site, and paste in the following line:

Quote:
SetEnv PHPRC /path/to/site/my_custom_php.ini
Once thats done, you can then go on to create your custom php.ini file. To achieve what you want to, you will need to paste the following into it:

Quote:
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
Thats all that done. To check that you are using the new custom php.ini file, create a PHP page containing the following text:

PHP Code:

<?php phpinfo(); ?>
Your custom php.ini file will affect your site only, and not the sites of other customers. It can also be done per directory, if needed.
__________________
Regards,
Josh Hold

eUKhost Blog: Over 1000 Computer Related Articles to Sink Your Teeth Into!

Super Moderator

I'm only a moderator, and do not work for eUKhost in any way. Opinions expressed by me are mine only, and do not reflect those of either eUKhost or any company that may be listed above.
Reply With Quote
  #8 (permalink)  
Old 04-02-2008, 07:57
Junior Member
 
Join Date: Jul 2007
Posts: 28
Smile

Thanks for that Flesso, you helped me solve the problem.

It also works if you just have a php.ini file in the directory.

Thanks all, Stu
Reply With Quote
  #9 (permalink)  
Old 14-02-2008, 11:41
Junior Member
 
Join Date: Jun 2007
Location: Marylebone, London
Posts: 10
Default

Thanks, this helped me out a lot too!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 19:13.

 

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

knowledgebase articles

popular blog categories