Disabling Magic Quotes GPC

cmelcher

Verified User
Joined
Sep 16, 2005
Messages
27
I'm trying to set up Joomla 3.0 and it requires that magic_quotes_gpc be disabled.

How do I do this?

I've tried creating a php.ini file in that directory
I've tried adding a rule to .htaccess

I can't seem to get it disabled.
 
I'm trying to set up Joomla 3.0 and it requires that magic_quotes_gpc be disabled.
Login to DirectAdmin, go to File editor and edit the php.ini there.

Find:

Code:
; Default Value: On
; Development Value: Off
; Production Value: Off
; [URL]http://php.net/magic-quotes-gpc[/URL]
; magic_quotes_gpc = Off

and uncomment the last line, like this:

Code:
; Default Value: On
; Development Value: Off
; Production Value: Off
; [URL]http://php.net/magic-quotes-gpc[/URL]
magic_quotes_gpc = Off

and save the file.
 
Hello

Run

Code:
php --ini

to see which one is used, usually it is one of the following:

/usr/local/lib/php.ini
/usr/local/etc/php5/cgi/php.ini
/usr/local/etc/php53/cgi/php.ini
/usr/local/etc/php54/cgi/php.ini
 
Last edited:
Configuration File (php.ini) Path: /usr/local/etc/php5/cgi
Loaded Configuration File: /usr/local/etc/php5/cgi/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
 
Would it be a terrible idea to just disable magic_quotes_gpc in the server's php.ini file?

I guess it's going to the wayside anyway. I wouldn't think it would pose much of a security issue. Or at least not much more than disabling it on a per-user basis.
 
Can't find php.ini file

Can't find or get access to php.ini file. Is there any other way to shut the magic quotes except asking the support service?
 
Questions: Disabling Magic quotes for a single domain on the server

First of all I don't understand why this is not an account by account setting in the DirectAdmin shell by now.

It has always been an issue and it seems to me that it would be a fairly easy fix on DirectAdmin's end.

Background:

I am running DirectAdmin and have multiple accounts and clients on the server.

Some of the accounts have software that requires magic quotes and I have a few sites that are running software where it should be turned off.

How do I disable Magic Quotes on a single domain?

I have tried inserting the line
php_value magic_quotes_gpc off
into the .htaccess file but there is a lot in there already and this causes a 500 server error.

The same occurs for
magic_quotes_gpc = Off

Is there another alternative?
 
Hello,

You need to migrate to CustomBuild 2 and use either mod_php+mod_ruid2 or PHP-CGI+htscanner if you want to change PHP settings in .htaccess file. With CustomBuild 1.x as it seems to me you are using suPHP which does not support PHP directives in .htaccess.
 
You can disable magic quotes per user with custombuild 1.1 or 1.2 and suphp.

Just add
magic_quotes_gpc = Off
to the user specific php.ini located in /usr/local/directadmin/data/users/xxx/php/
 
Back
Top