If access to the server configuration is unavailable, use of
.htaccess is also an option. For example:

php_flag magic_quotes_gpc Off

In the interest of writing portable code (code that works in any
environment), like if setting at the server level is not possible,
here's an example to disable
magic_quotes_gpc at runtime. This method is inefficient so
it's preferred to instead set the appropriate directives elsewhere.

These instructions are great. And if you have a site with an integrated shopping cart, then you will need to copy PHP.ini from the root of your site to the root folder of your shopping cart - otherwise you will still get errors on your cart pages.