简体   繁体   English

如何使用Go爸爸服务器禁用魔术报价?

[英]how to disable magic quotes using go daddy server?

I am hosting my site with go daddy and I am trying to disable magic quotes because at the moment i am getting text in my mysql table showing as jame'/s rather than just jame's . 我使用go daddy托管我的网站,并且尝试禁用魔术引号,因为此刻我正在mysql表中获取显示为jame'/s而不是jame's

I have tried doing this in .htaccess by adding: 我尝试通过添加以下内容在.htaccess执行此操作:

'php_flag magic_quotes_gpc Off' 

But this causes a 505 error. 但这会导致505错误。

I have tried to do php.ini and added: 我试图做php.ini并添加:

magic_quotes_gpc = Off;
magic_quotes_runtime = Off;
magic_quotes_sybase = Off;

And I have tried doing php5.ini with: 而且我尝试用以下方法来做php5.ini

magic_quotes_gpc = Off;

Nothing is working for me and I'm still getting a \\ where every ' should be. 没有什么工作对我来说,我仍然得到一个\\ ,每一个'应该是。 Why is it displayed like that? 为什么这样显示? What can I do to get rid of \\ . 我该怎么做才能摆脱\\

.htaccess won't work in shared hosting.Just try the following steps. .htaccess在共享托管中不起作用。只需尝试以下步骤。

A) Create a file named php5.ini and keep in the root folder, Add the following lines in it A)创建一个名为php5.ini的文件并保存在根文件夹中,在其中添加以下几行

magic_quotes_gpc = Off; magic_quotes_gpc =关;
magic_quotes_runtime = Off; magic_quotes_runtime =关闭;
magic_quotes_sybase = Off; magic_quotes_sybase =关闭;

B) A PHP initialization file is not always immediately recognized by the server. B)服务器并不总是立即识别PHP初始化文件。 After making the changes to your php5.ini file, you may need to use the following steps to force the updates to go through: 对php5.ini文件进行更改后,您可能需要使用以下步骤强制执行更新:

  1. Log in to your Account Manager. 登录到您的客户经理。
  2. Click Web Hosting. 单击虚拟主机。
  3. Next to the hosting account you want to use, click Launch. 在您要使用的托管帐户旁边,单击启动。
  4. In the Stats & Monitors section of the hosting Control Panel, click the System Processes icon. 在托管控制面板的“统计和监视器”部分中,单击“系统进程”图标。
  5. Click End Web and follow any prompts. 单击“结束网站”,然后按照提示进行操作。
  6. Reload the phpinfo.php page to see if the desired changes have taken effect. 重新加载phpinfo.php页面,以查看所需的更改是否已生效。

Try to change the php value into the PHP itself : 尝试将php值更改为PHP本身:

//At the beginning of the page
ini_set('magic_quotes_gpc', 'Off'); //Magic quotes for incoming GET/POST/Cookie data.
ini_set('magic_quotes_runtime', 'Off'); //Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
ini_set('magic_quotes_sybase', 'Off'); //Use Sybase-style magic quotes (escape ' with '' instead of \').

PHP Manual PHP手册

To turn off the magic quotes try this: 要关闭魔术引号,请尝试以下操作:

ini_set('magic_quotes_gpc', 'Off');

But I advice you to put this in .htaccess to turn off for the full website implementation 但我建议您将其放在.htaccess以关闭完整的网站实施

php_value magic_quotes_gpc off

This solved the issue for me: 这为我解决了这个问题:

http://support.godaddy.com/groups/web-hosting/forum/topic/error-installing-joomla-3-0-magic-quotes-gpc-off/ http://support.godaddy.com/groups/web-hosting/forum/topic/error-installing-joomla-3-0-magic-quotes-gpc-off/

Edit php5.ini in the webroot folder and add this to bottom. 在webroot文件夹中编辑php5.ini并将其添加到底部。

magic_quotes_gpc = Off
zend_extension=/usr/local/php53/lib/php/extensions/ioncube.so
zend_extension=/usr/local/php53/lib/php/extensions/ZendOptimizer.so

Make sure you put it at the end, it won't work at the beginning. 确保将其放在结尾,但开头不会起作用。

End web processes by following these steps (makes sure that the new php configuration is loaded http://support.godaddy.com/help/article/5647/why-isnt-my-phpini-file-taking-effect 通过执行以下步骤结束Web流程(确保已加载新的php配置http://support.godaddy.com/help/article/5647/why-isnt-my-phpini-file-taking-effect

Please note that if your hosting include many websites, you just need upload php5.ini to your root hosting folder (not root of website). 请注意,如果您的主机包含许多网站,则只需将php5.ini上传到您的根主机文件夹(而不是网站的根目录)。 I have try and get success now. 我已经尝试并获得成功。

Incase you are not success to turn magic_quotes_gpc off, please feel free to contact me by skype at boducoscar. 如果您无法成功关闭magic_quotes_gpc,请随时通过boducoscar的Skype与我联系。 I have searching and test nearly 1 day for only turn this off, so i know how disappointed you are in this problem :) 我已经搜索并测试了将近1天,只能将其关闭,因此我知道您在此问题中的失望程度:)

php5.ini code: php5.ini代码:

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM