Tutorial :PHP.ini does not work



Question:

I opened the notepad, inserted 3 lines in it, saved it as php.ini, and uploaded it in public_html, but I am still getting an error that requires to first switch the magic quotes off. The syntax of the three lines is as following:

magic_quotes_gpc = 0   magic_quotes_runtime = 0   magic_quotes_sybase = 0   

What am I doing wrong?


Solution:1

use phpinfo() function to see what php.ini file you're actually using


Solution:2

You can probably alter these settings in a .htaccess configuration file as well:

php_flag magic_quotes_gpc off  php_flag magic_quotes_runtime off  php_flag magic_quotes_sybase off  

See PHP: How to change configuration settings.


Solution:3

It's not meant to be placed in the public_html folder... it should be in your PHP installation folder.


Solution:4

Php.ini is not usually located in public_html. If you can't access your real php.ini, try writing

php_flag magic_quotes_gpc off  

in a .htaccess file (in public_html).


Solution:5

Most hosting companies won't let you play around with the php.ini unless you rent a dedicated server from them. On that, you could try on page php.ini settings like the following:

ini_set("magic_quotes_gpc", "0");  ini_set("magic_quotes_runtime", "0");   ini_set("magic_quotes_sybase", "0");  

If that doesn't work, then you'll have to ask your hosting company about it.


Solution:6

Most hosting companies lets you define a local ini file. Check their support pages, and see where you should put your php.ini file for it to be read by the php engine. If they have an option for this, you don't have to worry about restarting the server.

If you can't find any info about it, create a page with the following code:

<?php phpinfo(); ?>  

And look for the property named "Configuration File (php.ini) Path". This is where you should put the file.


Solution:7

Well, you have to change your main php.ini which I don't think is in public_html. Moreover, in order to see the changes you have to restart your php engine.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »