PHP:Deprecated:Function set_magic_quotes_runtime () is deprecated error

Source: Internet
Author: User

Deprecated:function set_magic_quotes_runtime () is deprecated error in installation phpcms, checked network and data found PHP5.3 and PHP6.0 removed set_magic _quotes_runtime () function.

Set_magic_quotes_runtime (0) function interpretation
In the php.ini configuration file, there is a Boolean setting that is Magic_quotes_runtime, and when it is turned on, most PHP functions automatically add backslashes to the overflow characters from externally introduced (including database or file) data.

Of course, if you repeat the overflow character alphanumeric backslash, then there will be multiple backslashes in the string, so you should use Set_magic_quotes_runtime () and Get_magic_quotes_runtime () Sets and detects Magic_quotes_runtime status in php.ini files.

To make your program work regardless of what the server is set to do. You can use Get_magic_quotes_runtime to detect settings in the program. Fall decides whether you want to manually process it, or turn it off with Set_magic_quotes_runtime (0) when you start (or do not need to escape automatically).

MAGIC_QUOTES_GPC sets whether the ' "/plus backslash is automatically in the data from the GPC (Get,post,cookie). You can use GET_MAGIC_QUOTES_GPC () to detect system settings. If this setting is not turned on, you can add it by using the addslashes () function, which adds a backslash to the needs of the database query statement, and so on. These characters are single quotes ('), double quotes ("), backslashes (/) and NUL (NULL characters).


Solution:

//@set_magic_quotes_runtime (0);

Ini_set ("Magic_quotes_runtime", 0);

is to use the Ini_set () method to replace the original Set_magic_quotes_runtime grammar.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.