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