Why your phpinfo () cannot be displayed

Source: Internet
Author: User
Tags phpinfo

First, the problem description

Write a php file test.php, the code is as follows:

<?php    Echo phpinfo ();? >

The browser accesses it, but returns NULL.

Second, problem location and solution

On the Internet, most of the problems encountered by people are actually short_open_tags, their code is as follows:

<?    Echo phpinfo ();? >

This situation is necessary to open the php.ini in Short_open_tags, and then reload the php.ini service is OK.

Here are two more questions, one is how to know which PHP is loading the php.ini file, can be executed at the command line: php-i | grep php.ini to find the php.ini file, the second is how to reload the php.ini file, how your server enabled PHP-FPM, in general, restart php-fpm OK, the command is: Service PHP-FMP restart, if not There are PHP-FPM services enabled (earlier versions of PHP), generally restarting the Apache service is OK, the command is service httpd restart.

Follow the above steps to complete, the majority of people encountered problems solved, but this is someone else's problem, and my is not a problem orz ...

Helpless, feel this thing must be with the PHP configuration has a relationship, so went to the official website to see the next php.ini document, inside a later configuration is as follows:

Disable_functions string    This directive allows you to disallow certain functions based on security reasons. Accept a comma-delimited list of function names as parameters. Disable_functions is not affected by security mode. This instruction can only be set in php.ini. For example, you cannot set it to a httpd.conf

PHP.ini inside can configure some methods, these methods cannot be called, open php.ini Find this configuration, sure enough phpinfo () This method is disabled, as follows:

Disable_functions = Phpinfo,system,proc_open,proc_close,show_source,popen,pclose

To here suddenly enlightened, temporarily put phpinfo () This method removed from the disable_functions, reload php.ini file, and then again from the browser to access test.php, this success, problem solving. But here to remind the small partners phpinfo () is very sensitive information, usually it is best not to expose to the client, so after the test I quickly turned off.

Why your phpinfo () cannot be displayed

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.