[英]How to turn off magic quotes gpc for Joomla 3?
I want to turn off PHP's magic quotes. 我想关闭PHP的魔术引号。 I don't have access to php.ini.
我无权访问php.ini。
Without this I am not able to install joomla 3.xx into server. 没有这个,我将无法将joomla 3.xx安装到服务器中。
Steps: 脚步:
MAMP application >> Preferences (button) >> PHP (tab) >> Choose 5.3.1 or greater >> choose OK
. MAMP application >> Preferences (button) >> PHP (tab) >> Choose 5.3.1 or greater >> choose OK
。 MAMP folder >> bin >> php >> php5.3.26 >> conf >> edit php.ini >> add "magic_quotes_gpc = Off"
a few lines above "magic_quotes_sybase = Off"
. MAMP folder >> bin >> php >> php5.3.26 >> conf >> edit php.ini >> add "magic_quotes_gpc = Off"
上方MAMP folder >> bin >> php >> php5.3.26 >> conf >> edit php.ini >> add "magic_quotes_gpc = Off"
几行"magic_quotes_sybase = Off"
。 Steps: 脚步:
Create a php.ini
or php5.ini
file with the following: 使用以下
php5.ini
创建一个php.ini
或php5.ini
文件:
magic_quotes_gpc = Off
Put it in your Joomla 3 root. 将其放在您的Joomla 3根目录中。 Then change the
htaccess.txt
in your Joomla 3 root to .htaccess
. 然后改变
htaccess.txt
在您的Joomla 3根.htaccess
。 Add the following lines to the .htaccess
file (at the top), don't forget to change php.ini
to php5.ini
when applicable : php5.ini
添加到.htaccess
文件中(在顶部),请不要忘记在适用时将php.ini
更改为php5.ini
:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/myusername/public_html/yourJ3folder
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>
Change " myusername
" and " yourJ3folder
" to your respective folders. 将“
myusername
”和“ yourJ3folder
”更改为各自的文件夹。 The " /home/myusername/public_html/yourJ3folder
" can be found via the Global Configuration: 可以通过全局配置找到“
/home/myusername/public_html/yourJ3folder
”:
In Joomla backend > System > System Information > [Directory Permissions]
, the folder is usually the same as the log directory (but without /logs at the end). 在
Joomla backend > System > System Information > [Directory Permissions]
,该文件夹通常与日志目录相同(但末尾没有/ logs)。
For some hosts, add the following to the .htaccess
file in the root of your site (for example /home/myusername/public_html/.htaccess
) 对于某些主机,将以下内容添加到网站根目录中的
.htaccess
文件中(例如/home/myusername/public_html/.htaccess
)
php_flag magic_quotes_gpc off
create a php.ini
file at your Joomla! 在您的Joomla上创建一个
php.ini
文件! root. 根。 Add this content to the file and save
将此内容添加到文件并保存
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
Edit your .htaccess
file and add this line at the top and save the file 编辑您的
.htaccess
文件,并在顶部添加此行并保存文件
SetEnv PHPRC /home/youruser/public_html/php.ini
Test if the error message goes away 测试错误消息是否消失
source : How to turn off magic quotes on shared hosting? 来源: 如何在共享主机上关闭魔术引号?
Works for PHP 5.3 and higher 适用于PHP 5.3及更高版本
create a .user.ini
file at your Joomla! 在您的Joomla上创建一个
.user.ini
文件! root. 根。 Add this content to the file and save
将此内容添加到文件并保存
magic_quotes_gpc = Off
SRC - https://docs.joomla.org/How_to_turn_off_magic_quotes_gpc_for_Joomla_3 SRC-https://docs.joomla.org/How_to_turn_off_magic_quotes_gpc_for_Joomla_3
From PHP documentation - http://php.net/manual/en/security.magicquotes.disabling.php 从PHP文档 -http://php.net/manual/zh/security.magicquotes.disabling.php
The magic_quotes_gpc directive may only be disabled at the system level, and not at runtime. magic_quotes_gpc指令只能在系统级别禁用,而不能在运行时禁用。 In otherwords, use of ini_set() is not an option.
换句话说,不能使用ini_set()。
BUT 但
If access to the server configuration is unavailable, use of .htaccess is also an option. 如果无法访问服务器配置,则也可以选择使用.htaccess。 For example:
例如:
php_flag magic_quotes_gpc Off
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.