16

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?

4

3 回答 3

14

phpinfo()对该特定托管服务提供商的免费帐户禁用。如果您想访问phpinfo().

于 2012-07-07T17:21:25.270 回答
9

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.).

于 2012-07-07T17:13:53.307 回答
5

检查您的php.ini文件,然后用 grep 查找disable_function

cat php.ini | grep -in "disable_function"

如果输出phpinfo在这一行中有这样的:

386:disable_functions = show_source、系统、shell_exec、passthru、exec、phpinfo、popen、proc_open

phpinfo编辑文件并从此行中删除并保存。您可能需要重新启动 httpd

service httpd restart
于 2015-12-16T20:58:57.470 回答