Home>

Open php.ini and find this line:

disable_functions =

Add the function i want to disable there,If multiple functions are disabled,Use commas to separate

Give an example:

disable_functions=passthru, exec, system, popen, chroot, scandir, chgrp, chown, escapesh
ellcmd, escapeshellarg, shell_exec, proc_open, proc_get_status

Functions suggested to be disabled on the host:

disable_functions=system, exec, shell_exec, passthru, proc_open, proc_close, proc_get_status, checkdnsrr, getmxrr, getservbyname, getservbyport, syslog, popen, show_source, highlight_file, dl, socket_listen, socket_create, socket_bind, socket_socept, client_cket_socket_cket_socket_cket_socket_cketcept, socket_cket_socket_client, socket_cketcept ftp_connect, ftp_login, ftp_pasv, ftp_get, sys_getloadavg, disk_total_space, disk_free_space, posix_ctermid, posix_get_last_error, posix_getcwd, posix_getegid, posix_geteuid, posix_getgid, posix_getgrgid, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgid, posix_getpgrp, posix_getpid, posix_getppid, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_getuid, posix_isatty, posix_kill, posix_mkfifo, posix_setegid, posix_seteuid, posix_setgid, pospos_setpgid, posix_setsid, posix_setuid, posix_strerror, posix_times, posix_ttyname, posix_uname

How to view the list of disabled functions on the host,I found a very good probe from the Internet

<?php
header ("content-type:text/html;charset=utf-8");
header ("cache-control:no-cache, must-revalidate");
header ("pragma:no-cache");
error_reporting (0);
ob_end_flush ();
?>
<! Doctype html public "-//w3c //dtd xhtml 1.0 transitional //en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="cache-control" content="private" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />//Added this sentence,See if you can solve the problem of garbled display under Linux?
<title>php probe v1.0</title>
<style type="text/css">
<!-
body {text-align:center;margin-top:20px;background-color:#a9b674;}
#overview {width:700px;margin:0 auto;text-align:left;}
a {text-decoration:underline;color:#992700;}
.strong {color:#992700;}
.basew {width:300px;}
->
</style>
</head>
<body>
<div>
<div>Copyright Information
<a href="hello.php?typ=baseinfo">[Basic Information]</a><a href="hello.php?typ=superinfo">[Advanced Information]< ;/a>
<?php
if (function_exists ("phpinfo")) {
  echo "<a href =" hello.php?typ=phpinfo ">[phpinfo]</a>";}
if (empty ($_ get ["typ"])) {
  baseinfo ();}
else {
switch ($_get ["typ"]) {
case "phpinfo":
phpinfoview ();
break;
case "superinfo":
superinfo ();
break;
case "baseinfo":
baseinfo ();
break;
default:
baseinfo ();}
}
function getime ()
{
 $t=gettimeofday ();
 return (float) ($t ["sec"] + $t ["usec"]/1000000);
}
function baseinfo () {
echo "&h1>basic information</h1>";
$arr []=array ("current php version:", phpversion ());
$arr []=array ("zend engine version:", zend_version ());
$arr []=array ("Server version", $_ server ["server_software"]);
$arr []=array ("ipaddress", $_ server ["remote_host"]);//ip
$arr []=array ("domain name", $_ server ["http_host"]);
$arr []=array ("protocol port", $_ server ["server_protocol"]. "". $_ server ["server_port"]);
$arr []=array ("site root directory", $_ server ["path_translated"]);
$arr []=array ("Server time", date ("y, m, d, h:i:s, d"));
$arr []=array ("current user", get_current_user ());
$arr []=array ("operating system", php_uname ("s"). php_uname ("r"). php_uname ("v"));
$arr []=array ("include_path", ini_get ("include_path"));
$arr []=array ("server api", php_sapi_name ());
$arr []=array ("error_reporting level", ini_get ("display_errors"));
$arr []=array ("post submission limit", ini_get ("post_max_size"));
$arr []=array ("upload_max_filesize", ini_get ("upload_max_filesize"));
$arr []=array ("Script timeout time", ini_get ("max_execution_time"). "Second");
if (ini_get ("safe_mode") == 0) {
$arr []=array ("phpsafe mode (safe_mode)", "off");}
else {
$arr []=array ("phpsafe mode (safe_mode)", "on");}
if (function_exists ("memory_get_usage")) {
$arr []=array ("memory_get_usage", ini_get ("memory_get_usage"));}
//$arr []=array ("Available space", intval (diskfreespace ("/")/(1024 * 1024)). "m");
echo "<table>";
for ($i=0;$i<count ($arr);$i ++)
{
  $overview="<tr><td>". $arr [$i] [0]. "&/td><td>". $arr [$i] [1]. "</td></tr>";
  echo $overview;
}
echo "</table>";
echo "<h2>server performance test</h2>";
echo "<table><tr><td>server</td><td>integer operation<br />500,000 additions (1 + 1)</td><td>Floating-point arithmetic<br/>500,000 times square root (3.14 square root)</td></tr>
echo "<tr><td>mkduse machine (p4 1.5g 256ddr winxp sp2)</td><td>465.08ms</td><td>466.66ms</td></tr>;";
$time_start=getime ();
for ($i=0;$i<= 500000;$i ++);
{$count=1 + 1;}
$timea=round ((getime ()-$time_start) * 1000,2);
echo "&tr><td>current server</td><td>". $timea. "ms</td>";
$time_start=getime ();
for ($i=0;$i<= 500000;$i ++);
{sqrt (3.14);}
$timea=round ((getime ()-$time_start) * 1000,2);
echo "<td>". $timea. "ms</td></tr></table>";
?>
<script language="javascript" type="text/javascript">
function gettime ()
{
 var time;
 time=new date ();
 return time.gettime ();
}
start_time=gettime ();
</script>
<?php
echo "<h2>Bandwidth Test</h2>";
for ($i=0;$i<100;$i ++) {
print "<!-1234567890 #########0 #########0 #########0 #########00 ##################00 #####################012345->";}
?>
<p></p>
<script language="javascript" type="text/javascript">
var timea;
var netspeed;
timea=gettime ()-start_time;
netspeed=math.round (10/timea * 1000);
document.getelementbyidx ("dk"). innerhtml="Send 10kb data to the client, it takes" + timea + "ms<br />Your connection speed with this server is" + netspeed + "kb/s";
</script>
<?php
echo "<h2>Loaded extension library (enable)</h2><div>";
$arr=get_loaded_extensions ();
foreach ($arr as $value) {
  echo $value. "<br />";}
echo "</div><h2>disabled functions</h2><p>";
$disfun=ini_get ("disable_functions");
if (empty ($disfun)) {
  echo "is not disabled</p>";}
else {
echo ini_get ("disable_functions"). "</p>";}
}//shut down
function superinfo () {
echo "<h1>Advanced Information</h1><p>php_ini_user 1 configuration options available in user's php script or windows registry<br>php_ini_perdir 2 configuration options available in php.ini, .htaccess or httpd<br>php_ini_system 4 configuration options can be set in php.ini or httpd.conf<br>php_ini_all 7 configuration options can be set everywhere</p>";
$arr1=ini_get_all ();
for ($i=0;$i<count ($arr1);$i ++)
  {
$arr2=array_slice ($arr1, $i, 1);
print_r ($arr2);
echo "<br />";
}
}
function phpinfoview () {
  phpinfo ();
}
?>
</div>
</body>
</html>
php
  • Previous Detailed use of MvcPager for MVC paging
  • Next Powerful php paging function