J3.x

Difference between revisions of "How to turn off magic quotes gpc"

From Joomla! Documentation

(Created page with " == For MAMP == Steps: 1) Go to MAMP application >> Preferences (button) >> PHP (tab) >> Choose 5.3.1 or greater >> choose OK. 2) Go to the MAMP folder >> bin >> php >> php5.3...")
 
(7 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
== For MAMP ==
 
== For MAMP ==
 
Steps:
 
Steps:
1) Go to MAMP application >> Preferences (button) >> PHP (tab) >> Choose 5.3.1 or greater >> choose OK.
+
* Go to MAMP application >> Preferences (button) >> PHP (tab) >> Choose 5.3.1 or greater >> choose OK.
2) Go to the MAMP folder >> bin >> php >> php5.3.6 >> conf >> edit php.ini >> add "magic_quotes_gpc = Off" a few lines above "magic_quotes_sybase = Off".
+
* Go to the MAMP folder >> bin >> php >> php5.3.6 >> conf >> edit php.ini >> add "magic_quotes_gpc = Off" a few lines above "magic_quotes_sybase = Off".
3) Restart MAMP's servers.
+
* Restart MAMP's servers.
  
== For Rochen or some other Joomla hosts similar to its setup ==
+
== For most mainstream hosting companies running a CGI-Webinterface ==
 
Steps:
 
Steps:
Create a php.ini file with the following:
+
* Create a php.ini file with the following:
magic_quotes_gpc = Off
+
<pre>magic_quotes_gpc = Off
 
extension=pdo.so
 
extension=pdo.so
extension=pdo_mysql.so
+
extension=pdo_mysql.so</pre>
  
Put it in your Joomla 3 root. Then change the htaccess.txt in your Joomla 3 root to .htaccess. Add the following lines to the .htaccess file (at the top) :
+
* Put it in your Joomla 3 root. Then change the htaccess.txt in your Joomla 3 root to .htaccess. Add the following lines to the .htaccess file (at the top) :
<IfModule mod_suphp.c>
+
<pre><IfModule mod_suphp.c>
 
   suPHP_ConfigPath /home/myusername/public_html/yourJ3folder
 
   suPHP_ConfigPath /home/myusername/public_html/yourJ3folder
 
   <Files php.ini>
 
   <Files php.ini>
Line 20: Line 20:
 
     deny from all
 
     deny from all
 
   </Files>
 
   </Files>
</IfModule>
+
</IfModule></pre>
  
Change "myusername" and "yourJ3folder" to your respective folders.
+
Change "myusername" and "yourJ3folder" to your respective folders. The "/home/myusername/public_html/yourJ3folder" can be found via the Global Configuration:
 +
 
 +
In Joomla backend > System > System Information > [Directory Permissions], the folder is usually the same as the log directory (but without /logs at the end).
  
 
== .htaccess for some hosts ==
 
== .htaccess for some hosts ==
  
For some host, add "php_flag magic_quotes_gpc off" to the .htaccess file
+
For some hosts, add "php_flag magic_quotes_gpc off" to the .htaccess file
 +
<noinclude>[[Category:Server configurations]]</noinclude>

Revision as of 00:54, 10 May 2013

For MAMP[edit]

Steps:

  • Go to MAMP application >> Preferences (button) >> PHP (tab) >> Choose 5.3.1 or greater >> choose OK.
  • Go to the MAMP folder >> bin >> php >> php5.3.6 >> conf >> edit php.ini >> add "magic_quotes_gpc = Off" a few lines above "magic_quotes_sybase = Off".
  • Restart MAMP's servers.

For most mainstream hosting companies running a CGI-Webinterface[edit]

Steps:

  • Create a php.ini file with the following:
magic_quotes_gpc = Off
extension=pdo.so
extension=pdo_mysql.so
  • Put it in your Joomla 3 root. Then change the htaccess.txt in your Joomla 3 root to .htaccess. Add the following lines to the .htaccess file (at the top) :
<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. The "/home/myusername/public_html/yourJ3folder" can be found via the Global Configuration:

In Joomla backend > System > System Information > [Directory Permissions], the folder is usually the same as the log directory (but without /logs at the end).

.htaccess for some hosts[edit]

For some hosts, add "php_flag magic_quotes_gpc off" to the .htaccess file