You are invited to Log in or Register a free Frihost Account!

How to set magic_quotes_gpc = Off in htaccess or php.ini

I was trying to install Open Web Analytics because piwik needed PHP 5.3 which server 2 does not have(long story)

But it seems some PHP setting magic_quotes_gpc is currrently set as 1 or On

It seems I have to turn it off

One of the ways suggested was to put it in the htaccess file
php_flag magic_quotes_gpc off

But when I do that, I get a 500 redirect error on my wordpress.

Is there any particular tag under which I have to put it ?
There is already a mod rewrite tag in my htaccess for the wordpress post title to URL rewrite

Another option given was to use a php.ini file with
magic_quotes_gpc = Off

This does not seem to have any effect at all Rolling Eyes

Then another place mentioned putting an extra line in htaccess file to link to the php.ini but not sure of the URL to the php.ini

Is there any way to test if my php.ini is working or not ?
Finally got it to work.

Used htaccess in the separate folder and php.ini
php_flag magic_quotes_gpc off

This might have been the problem

The PHP settings defined in your php.ini file are not recursive. What this means is that they do not modify settings in any child folders (which are subdirectories of the current directory).

Still confused, here's an example.

Let's say you have a php.ini file in your public_html folder. That php.ini file has the PHP memory_limit set to 256M. Only scripts that run directly in your public_html folder will have the memory_limit set to 256M. If you have a folder named public_html/employees, that "employees" folder will not be affected by the public_html/php.ini file, it would only be affected by a php.ini file located in its own folder, public_html/employees

If you have many folders, creating a php.ini file for each folder would be quite tedious. What you can do is update your .htaccess to tell the server that the public_html/php.ini file should apply not only to public_html, but to any folders within that folder (such as public_html/employees or public_html/about-us).
Had more problems during installation.

It could not create the config file by itself, so had to make it manually.

Finally it worked Cool
Related topics
[Dúvidas] Pontos
Where is the php.ini file?
A Question about the PHP.INI file.
FATAL ERROR: register_globals is disabled in php.ini
how to config php ini for mail locally
PHP reading a line?
a bit of help with my php.ini, please?
error in PHP.ini
PHP.ini and MYSQL databases
Disabling magic_quotes - Joomla 3
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

© 2005-2011 Frihost, forums powered by phpBB.