phpinfo() is not working it shows blank page but other php working
Question
I am completely lost as to why this is happening. I am on a server x10hosting. I have a PHP file named "phpinfo.php". Inside this file it says
<?php phpinfo(); ?>
It doesn't say <? phpinfo(); ?>
For all I can tell it should be perfectly fine. If I try other PHP code they work.
For example
<?php
echo '<div>hello World</div';
?>
works perfectly. What could possibly be the problem?
La solution
phpinfo()
is disabled for free accounts on that particular hosting provider. You have to upgrade if you want access to phpinfo()
.
Autres conseils
Use error_reporting(E_ALL);
and ini_set('display_errors', TRUE);
you might find an error saying that phpinfo
is on the restricted functions list (x10hosting may not want anyone to find out their configurations/ weaknesses etc.).
Check your php.ini
file, and grep for disable_function
:
cat php.ini | grep -in "disable_function"
If the output has phpinfo
in this line as such:
386:disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
edit the file and remove phpinfo
from this line and save. You may need to restart httpd
service httpd restart