Magic Quotes GPC Off ?

Need help installing Joomla! 3.x? For all Joomla! 3.x installation issues please use this forum.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
steinipe
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Apr 25, 2013 5:32 pm

Re: Magic Quotes GPC Off ?

Post by steinipe » Thu Apr 25, 2013 5:53 pm

There is one thing people seam to forget here, some hosting companies including the one i work as a support for do have magic_quotes set to off but they do not allow the use of system(), phpinfo(), exec() and functions that are and can be harmful to the shared environment. Joomla uses one of these functions to check if magic_quotes is set to off and gives a false positive, and like a lot of companies we do not allow custom php.ini which handcuffs us. We have to advice people to stop uploading their joomla and extracting it and rather use our Softaculous one click installer which bypasses this redicilous bump in the road!.. I just wanted to say this because it's sometimes that the Hosting company has it right but doesn't allow functions that can be harmful to the server if exploited and im not about to allow these functions every single time so one user can install joomla!.. I say remove this REQUIREMENT and give the hosting company a RECOMMENDATION!

ozstar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 136
Joined: Wed Dec 27, 2006 11:41 pm
Location: Sydney Oz

Re: Magic Quotes GPC Off ?

Post by ozstar » Sun May 12, 2013 10:11 pm

Hi,

On my host VentraIP in Oz , I do not have access to php.ini, however in their Control Panel I can customize it a little including Magic on/off. I turned it off and it was fine.

I did however think I turned off

magic_quotes_runtime:

Should this be off or on.


EDIT:

It seems i cannot go any further than this initial page now. I filled in the language, site name and contact details for admin but when I hit NEXT nothing happen. Not a blink.

I also notice that in the last option Site online/offline, there is no button or option, just the text.

Thanks


oz

magic_quotes_runtime: Off
Magic Quotes for runtime-generated data, eg SQL or exec().

ozstar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 136
Joined: Wed Dec 27, 2006 11:41 pm
Location: Sydney Oz

Re: Magic Quotes GPC Off ?

Post by ozstar » Sun May 12, 2013 11:50 pm

I still did not have any glee placing the php.ini files in root and admin, so decided to upload again to site.

Did this and it works fine now.

Mind you, I still have php.ini files there so not sure if they really need to be there. Might test later.

oz

mtv134
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri May 17, 2013 10:20 pm
Contact:

Re: Magic Quotes GPC Off ?

Post by mtv134 » Fri May 17, 2013 10:29 pm

Hi Guys

I tried almost everything in this page to install Joomla on Godady shared hosting including the php.ini modification but no use. The installation page still shows me that the Magic Quotes GPC is On.

Any solution for this?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44070
Joined: Sat Apr 05, 2008 9:58 pm

Re: Magic Quotes GPC Off ?

Post by Webdongle » Fri May 17, 2013 10:42 pm

It can take several hours before changes to .htaccess are recognised on a gddy server. Suggest you find a decent Host.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Markus32
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon May 20, 2013 6:55 pm
Contact:

Re: Magic Quotes GPC Off ?

Post by Markus32 » Mon May 20, 2013 7:04 pm

silicon_chip wrote: ...
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
...

session.save_path = "/tmp"
Thank you so much!

Now it's working

riyosakura
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sat May 25, 2013 5:46 am

Re: a workaround Magic Quotes and Joomla 3.0

Post by riyosakura » Sat May 25, 2013 6:31 am

3rdlion wrote:I decided to move this into its own thread. Hopefully this saves some other people time in getting their Joomla 3.0 site up and running.

Preamble
I've been seeing quite a few questions relating to Magic Quotes needing to be turned off in order to install Joomla 3.0 Many of the responses ask you to alter the php.ini or edit other high level server config.

All of this unnecessary server tinkering is just madness!
You can't even install Joomla 3.0 without turning off Magic Quotes.
And its these kind of UX blocks that put Joomla so far backwards it's not even funny.

In many cases altering php.ini is just not possible (shared hosting etc).
Magic Quotes Enable sites have existed no problem alongside Anti Magic Quotes sites, so what changed in Joomla 3.0? Why should you alter your server config?

With some careful editing, you can turn the clock back to the way things used to be and use Joomla 3.0 with Magic Quotes turned ON!

Here's how to do it:
PART 1
  • Step 1 Download the latest Joomla 3.0
  • Step 2 Extract the files on your server
  • Step 3 Open your favourite PHP editor
  • Step 4 Navigate and open installation/models/setup.php
  • Step 5 Scroll down to find line 234

Code: Select all

// Check for magic quotes gpc.
$option = new stdClass;
$option->label  = JText::_('INSTL_MAGIC_QUOTES_GPC');
$option->state  = (ini_get('magic_quotes_gpc') == false);
$option->notice = null;
$options[] = $option;
  • Step 6 Comment out the code above and save the file
Now you can install Joomla 3.0 no problem.
IMPORTANT
However, Magic Quotes and Joomla's new special character escaping will cause duplicate escaping when editing/creating content. This renders anything that's not plain text incorrectly. So, we need to add one small condition to the core (this used to exist pre Joomla 3.0)
PART 2
  • Step 1 Navigate and open libraries/joomla/filter/input.php
  • Step 2 Scroll down to find line 261

Code: Select all

public function clean($source, $type = 'string')
{
	// Handle the type constraint
	switch (strtoupper($type))
	{...
	}
	// -- ADD THIS CODE HERE
	// Handle magic quotes compatibility
	if(get_magic_quotes_gpc()) $result = self::_stripSlashesRecursive($result);
}
  • Step 3 Add the code marked above to the clean function
  • Step 4 You may have noticed we're only running this when Magic Quotes is set to ON and referring to a new function called _stripSlashesRecursive. Now, we need to add that function to the class.
    Scroll to line 755 and add the following function:

Code: Select all

/**
 * Strips slashes recursively on an array.
 *
 * @param   array  $value  Array or (nested arrays) of strings.
 *
 * @return  array  The input array with stripslashes applied to it.
 *
 * @deprecated  12.1 - Sanctioned on 2012-10-09 thanks to Anton Wintergerst
 * @since       11.1
 */
protected static function _stripSlashesRecursive($value)
{
    $value = is_array($value) ? array_map(array('JFilterInput', '_stripSlashesRecursive'), $value) : stripslashes($value);
    return $value;
}
If you want to learn about why Joomla is trying to force us to disable Magic Quotes then check out this link:
http://www.php.net/manual/en/security.m ... whynot.php
this post has helped me to resolve the magic quote problems...:D
Thanks Dude...
But I still don't understand what's the problem with hack code...as long as I can get rid of the magic quote problem...anything will be good...:D

horaciolopes
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Sep 28, 2012 10:21 am
Location: Setúbal
Contact:

Re: Magic Quotes GPC Off ?

Post by horaciolopes » Sat May 25, 2013 2:32 pm

humvee wrote:[Mod note: Glad you managed to resolve it for yourself. Thank you for providing your solution to this issue for others to see.
Marked Resolved]


When you create a local php.ini as originally indicated and added it to the joomla_root/ directory you must also add a copy to the joomla_root/administrator/ directory too, that way both the site index.php and the administrator index.php are working from the same song sheet!
Hello Humvee,
Beginners question....
After the installation of Joomla 3.1, do I have to keep that php.ini file in those locations?

Or can I delete it?

Thank You

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 20652
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S'pore/Bogor/ North America
Contact:

Re: Magic Quotes GPC Off ?

Post by leolam » Sat May 25, 2013 3:15 pm

horaciolopes wrote:After the installation of Joomla 3.1, do I have to keep that php.ini file in those locations?

Or can I delete it?
Delete since the usage of such PHP.in depends completely on the particular hosting provider

Leo 8)
Joomla's #1 Professional Services Provider:
#Joomla Professional Support: https://gws-desk.com -
#Joomla Specialized Hosting Solutions: https://gws-host.com -

veivei
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Feb 23, 2007 8:03 pm

Re: Magic Quotes GPC Off ?

Post by veivei » Mon May 27, 2013 1:40 am

This is so freaking confusing.
Why don't the Joomla developer here fix the goddamn issue and release the version without this problem on magic quote stuff like the older version????? If it's a common problem, then why not fix it before release it?
I'm not a coder, I'm just a user, and because of this issue I can't build an easy site like I use to.

alpinevp
Joomla! Intern
Joomla! Intern
Posts: 96
Joined: Fri Oct 31, 2008 10:24 pm
Location: San Diego, CA

Re: Magic Quotes GPC Off ?

Post by alpinevp » Tue May 28, 2013 6:56 pm

I agree with the last post, why the [censored] can't the J dev's just fix this issue from within the 3.1 code. I just spent the better part of 90 minutes wasting my [censored] time with GoDaddy assholes who are worthless [censored] pond scum idiots trying to resolve this issue. Clearly Joomla 3.1. whatever the [censored] is not ready for world consumption.

Where do I send the bill for my wasted time to?

3+user
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jun 03, 2013 10:51 pm

Re: Magic Quotes GPC Off ?

Post by 3+user » Mon Jun 03, 2013 11:19 pm

I'm using network solutions.com and upgrading an old joomla 1.5 web to Joomla 3.

Joomla 3 installation stalled because of register globals = ON and magic quotes GPC = ON

Adding php.ini files didn't work, .htaccess returned an error page on the domain.

- but there is a file called php.coalesced.ini in the /cgi-bin/.php folder in the in the root on the server.

I could easily change the contents and with TextEdit (Mac) (after moving the file to my computer with ftp/FileZilla)

In my case I changed register_globals = Off and added the line magic_quotes_gpc = Off. Once the new file was saved in the original folder on the host, I could keep on with the installation and everything seems to work.
:)

moniquesn333
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jun 06, 2013 12:54 am

Re: Magic Quotes GPC Off ?

Post by moniquesn333 » Thu Jun 06, 2013 1:47 am

I tried to turn the magic quotes off but my cpanel didn't give me the option of "php variables manager" so I contacted my host and asked him to do it and I am not sure if he did. I can't make any changes, edit, add links. Especially the links are not working. Here is my site and just one example of an error:

http://itjvallereal.com.mx/

Go to the menu "DESIGN" and then all the way down to "Test ITJ". When the new article is opened (sample text), I added a link to a webpage http://www.itjgdl.edu.mx and when you click on the link I get this error:

Not Found
The requested URL /"//"http:/itjgdl.edu.mx///"/" was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

And in the address bar I get: http://itjvallereal.com.mx/%22//%22http ... ///%22/%22

........So my question is...does this have to do with "magic quotes"????
Thanks!
Monica S.
You do not have the required permissions to view the files attached to this post.

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Magic Quotes GPC Off ?

Post by sovainfo » Thu Jun 06, 2013 3:28 am

Very likely!

Check in the backend:
- go to System information tab PHP Settings; Magic Quotes, line 8, must be off
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

moniquesn333
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jun 06, 2013 12:54 am

Re: Magic Quotes GPC Off ?

Post by moniquesn333 » Thu Jun 06, 2013 3:38 am

THANKS SO MUCH! I just checked were you told me and Magic Quotes appear "on"....is there a way I can change if my host doesn't want to...since I installed joomla, I asked him to do it and he told me I don't know why they ask you to do that, it is not necessary so I don't know what he did so I could continue with the installation...but obviously they are ON.

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Magic Quotes GPC Off ?

Post by sovainfo » Thu Jun 06, 2013 4:18 am

The requirements for J3 state MQ must be off. Even your host should be able to understand that!

Yes, you might be able to do it yourself. Unfortunately it depends on the configuration of the host you are using.

If you are lucky it allows you to turn it off in .htaccess:
php_flag magic_quotes_gpc Off

Considering the reply of your host you are not that lucky:
- Create an php.ini in the root of your webspace with
magic_quotes_gpc = Off
- Add to .htaccess:
suPHP_ConfigPath /home/username/public_html

Where /home/username/public_html is the physical path to your webspace. See DOCUMENT_ROOT in System information tab PHP Information
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

moniquesn333
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jun 06, 2013 12:54 am

Re: Magic Quotes GPC Off ?

Post by moniquesn333 » Thu Jun 06, 2013 4:35 am

THANKS FOR YOUR SUPPORT!!!!!!!

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Magic Quotes GPC Off ?

Post by sovainfo » Thu Jun 06, 2013 5:18 am

You are welcome, hope one of the two works. If not, try to convince your hoster.

You can use the fact MQ is deprecated by PHP as an argument. This means the developers of PHP recognized having this setting is a bad thing. It is/will be removed from PHP.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

moniquesn333
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jun 06, 2013 12:54 am

Re: Magic Quotes GPC Off ?

Post by moniquesn333 » Thu Jun 06, 2013 12:41 pm

Great, clear, and fast support!!! THANkS again! <3!!!

User avatar
kiki_hoops
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Mon Jun 17, 2013 2:13 pm
Location: United States of America

Re: Magic Quotes GPC Off ?

Post by kiki_hoops » Mon Jun 17, 2013 2:58 pm

I just talked to my host [yahoo small business] >:( and they told me that they currently have no way of turning this off. How is that possible? I think it's more of an "I don't feel like it" response.

I've also tried adding the php.ini files and that didn't work. Yahoo! also doesn't utilize .htaccess files, so that does me no good.

I have used Joomla before and am determined to use it again, however yahoo is making this beyond difficult!! any yahoo-specific suggestions?! I've tried all of the suggestions in here already, minus the core hack. :geek: Perhaps I did something incorrectly, but it's another year until my boss renews the hosting plan and she doesn't want to change now. SOOOO - I miss Joomla and want it back in my life, but i'm almost at wit's end (through no fault of yours!)

hirudo
I've been banned!
Posts: 24
Joined: Sat Apr 13, 2013 11:40 am

Re: Magic Quotes GPC Off ?

Post by hirudo » Sun Jul 14, 2013 12:53 am

I have a godaddy hosting, I want to install joomla 3.0 but I faced an error: Magic Quotes GPC Off how can I turn off the Magic Quotes GPC?

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Magic Quotes GPC Off ?

Post by sovainfo » Sun Jul 14, 2013 7:46 am

First of all you should ask your provider. Next you should google both this forum and your providers. That will reveal http://support.godaddy.com/groups/web-h ... e=2&num=15
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 20652
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S'pore/Bogor/ North America
Contact:

Re: Magic Quotes GPC Off ?

Post by leolam » Sun Jul 14, 2013 2:28 pm

kiki_hoops wrote:I just talked to my host [yahoo small business] >:( and they told me that they currently have no way of turning this off. How is that possible? I think it's more of an "I don't feel like it" response.

I've also tried adding the php.ini files and that didn't work. Yahoo! also doesn't utilize .htaccess files, so that does me no good.
You cannot host any site on Yahoo properly since they also do not support SEO to mention one besides what you mentioned. Boss or no boss nothing to do with Joomla so change host. Yahoo sucks with "hosting" They only cater for basic straight forward HTML-websites and for the rest forget it!

Leo 8)
Joomla's #1 Professional Services Provider:
#Joomla Professional Support: https://gws-desk.com -
#Joomla Specialized Hosting Solutions: https://gws-host.com -

User avatar
kiki_hoops
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Mon Jun 17, 2013 2:13 pm
Location: United States of America

Re: Magic Quotes GPC Off ?

Post by kiki_hoops » Mon Jul 15, 2013 11:39 am

leolam wrote:You cannot host any site on Yahoo properly since they also do not support SEO to mention one besides what you mentioned. Boss or no boss nothing to do with Joomla so change host. Yahoo sucks with "hosting" They only cater for basic straight forward HTML-websites and for the rest forget it!

Leo 8)
Leo - that's what i have learned over the last week! ALso - their customer service is WRETCHED! I'm switching ASAP!

ededi
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Feb 02, 2009 10:32 pm

Re: Magic Quotes GPC Off ?

Post by ededi » Sun Aug 04, 2013 2:20 pm

Ok if you have problems after try in hours days months pls follow this steps hope help you because resolved mine problem :

1. delete all files and upload again the files to ftp ( important ! must fresh install)
2. after finished rename htaccess.txt to .htaccess
3. put this code on the top , above in .htaccess
php_flag magic_quotes_gpc off

and save it ...

thats all :p ;)

knowlengr
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Dec 31, 2006 8:20 pm
Contact:

Re: Magic Quotes GPC Off ?

Post by knowlengr » Mon Aug 05, 2013 3:02 pm

Opinion: A tweak that started out with "magic" in the name was going to be trouble.

On my web host, the solution was user.ini. See here http://[no tiny url]/12UGsla for details if that suits your configuration. Not sure, but I didn't see that solution in a skim of this thread.

I recommend the lengthy analysis http://[no tiny url]/194kf6R by AITPro for background understanding on specific configurations.

User avatar
Amgeek
Joomla! Intern
Joomla! Intern
Posts: 53
Joined: Sat Jun 09, 2007 2:57 pm
Location: Upstate NY USA
Contact:

Re: Magic Quotes GPC Off ?

Post by Amgeek » Sun Aug 11, 2013 9:49 pm

My host says Magic Quotes are off and suggest that Joomla! just can't see it.



Magic Quotes is depreciated in PHP 5.3, and does not function. The server is running PHP 5.3.27. Therefore, it can't really be enabled. Here is a post directly from Cpanel on the same issue you are experiencing:

<<If you are using 5.3.10 or above, you can just simply disregard the message entirely.

In the earlier releases of PHP 5.3.x series, "Magic Quotes" was deprecated and then in the latest releases was eliminated entirely in preparation for the now released PHP 5.4 release.

When it was eliminated, a lot of programs coded to check to see if you have it enabled or not did not know how to deal with the condition of it not existing and often report that it's enabled when actually it's just simply gone entirely.

If you are running PHP 5.3.10 or higher, I'd say don't worry about the message --- it's a false alarm and nothing more.>>



Is this a "Bug" in Joomla!?

Can it be corrected/reported?

How can I "ignore" it, Joomla won't install.

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12785
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Magic Quotes GPC Off ?

Post by brian » Sun Aug 11, 2013 10:01 pm

I think I trust php more than your host

http://php.net/manual/en/security.magicquotes.php
This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

User avatar
Amgeek
Joomla! Intern
Joomla! Intern
Posts: 53
Joined: Sat Jun 09, 2007 2:57 pm
Location: Upstate NY USA
Contact:

Re: Magic Quotes GPC Off ?

Post by Amgeek » Sun Aug 11, 2013 10:46 pm

Yes, Brian, exactly!

That is what my host is saying. That is the problem. They can't turn off what is not there but Joomla can't see that it is not. :eek:

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12785
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Magic Quotes GPC Off ?

Post by brian » Sun Aug 11, 2013 10:51 pm

Read again

Your host is running 5.3.27 which DOES have magic quotes
5.3.27 is less than 5.4.0

So yes they can turn it off if they had a clue

The alarm bells about the quality of your host should be ringing very loud.

Deprecate means marked for removal - it does not mean it has been removed
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/


Locked

Return to “Installation Joomla! 3.x”