简体   繁体   中英

i am looking for an alternative to the php-info file as the server i am on will not allow it to run, is there any alternate code i can use?

currently on the server a large amount of php scripts have been locked out is there any alternative to the phpinfo file that would be able to run as html or be able to pull php info through command line/ SSH?

depending on what you're looking for, you can see the values for any of the superglobals

eg: $_SERVER

<h2>Server: </h2>
<?php
echo "<pre>".print_r($_SERVER,1)."</pre>";
?>

For the ini_$ values, you can use ini_get_all :

<h2>ini presets: </h2>
<?php
echo "<pre>".print_r(ini_get_all(),1)."</pre>";
?>

The "phpinfo file" you're describing is almost certainly just calling the PHP's built in phpinfo() function that renders PHP's configuration as an HTML table.

<?php
phpinfo();

renders this:

在此处输入图像描述

From the command line, you can also run the following command to get PHP's configuration:

$ php -i

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM