May I ask: code-level rewrite phpinfo

Source: Internet
Author: User
Tags apd
For security reasons, you need to block or rewrite phpinfo () on some pages (). however, php does not support method coverage. if the built-in method prompts an error, you can ask for help! It only needs to be partially shielded. You still need to use phpinfo for debugging in the silent writing, and it is not realistic to modify the configuration. For more information, see code-level rewrite phpinfo.
For the sake of security, you need to block or rewrite phpinfo () on some pages. However, php does not support method override. if the built-in method is overwritten, an error is Prompted. I am sorry to ask you!
It only needs to be partially shielded. You still need to use phpinfo for debugging in the silent writing, and the modification in the configuration is not realistic. after all, some virtual hosts do not support direct modification of php. ini. can I directly block or replace the phpinfo () method in the PHP file ???

------ Solution --------------------
You can use ini_set () to set it:
PHP code
  ". Ini_get ('output _ handler')." \ n ";?>
------ Solution --------------------
Support for PECL apd extension is required to rewrite php built-in functions.

The PECL apd website has not been updated for several years. It is estimated that php5.3 is supported.
------ Solution --------------------
You cannot do this. Disable_functions settings cannot be set through ini_set. they can only be set directly in the php. ini file, and php certainly does not support rewriting default functions.

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.