Results 1 to 3 of 3

Thread: php.ini

  1. #1
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default php.ini

    trying to turn off magic quotes and it's not working. any ideas?

    php.ini
    Code:
    magic_quotes_gpc = Off

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Are you using PHP 6? If so, that feature is disabled.

    Happy coding!

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    no, 5.2.11

    (I'd be real happy if I didn't have to worry about it - so much trouble, putting user input through several scripts generates so many extra \\\\'s. And, as I'm sure you know, \\' completely defeats the purpose of escaping that ' in the first place... )

    I've already tried the .htaccess method on that page, as well. However, on the second glance, I saw this:

    I have discovered that my host doesn't like either of the following directives in the .htaccess file:

    php_flag magic_quotes_gpc Off
    php_value magic_quotes_gpc Off

    However, there is another way to disable this setting even if you don't have access to the server configuration - you can put a php.ini file in the directory where your scripts are with the directive:

    magic_quotes_gpc = Off

    However, these does not propogate unlike .htaccess rules, so if you launch from a sub-directory, you need the php.ini file in each directory you have as script entry points.
    which seems to address my problem... But it seems excessive, having to put a php.ini file in every script directory. I'm waiting to hear back from my web host, I hope this doesn't turn out to be necessary.

    Edit: the above does work, even though it's a little tedious. But I guess that's life.
    Last edited by traq; 10-19-2009 at 03:22 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •