Errors reported when deploying cacti and php5.3.6

Source: Internet
Author: User
When cacti and php5.3.6 are deployed, an error is reported. I know that php version is too high, but I don't want to downgrade it, but php is not very helpful. please help me to see how to change the code. This error is reported before modification. PHPDeprecated: Functionereg_replace () isdeprecatedinusrlocalapache2htdocslibsnmp. php deploys cacti and php5.3.6 to report an error.
I know that php version is too high, but I don't want to downgrade it, but php is not very helpful. please help me to see how to change the code.
This error is reported before modification.
PHP Deprecated: Function ereg_replace () is deprecated in/usr/local/apache2/htdocs/lib/snmp. php on line 341
PHP Deprecated: Function ereg_replace () is deprecated in/usr/local/apache2/htdocs/lib/snmp. php on line 426

Code:
$ String = trim (ereg_replace ("{. * = ?} "," ", $ String ));
$ String = ereg_replace (REGEXP_SNMP_TRIM, "", $ string );

After changing ereg_replace to preg_replace, the following error is reported for the last two sections of code:
PHP Warning: preg_replace (): No ending delimiter '.'
PHP Warning: preg_replace (): Unknown modifier

What is going on? how can this problem be solved?



------ Solution --------------------
PHP Deprecated: this is a warning specific to php5.3. it indicates that the function is already in the elimination plan. we recommend that you do not use it.
The simplest solution is to block this error category.

If you use other functions, you have to comply with people's conventions. who can blame you for making a mistake?
------ Solution --------------------
Instead of replacing it with preg_replace. The first parameter of this function is regular. Your format is incorrect. The regular expression should use // or # as the break-down character.
------ Solution --------------------
You need to clarify your needs first. What else do I need to replace? {. * = ?} And REGEXP_SNMP_TRIM?

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.