Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

php µ÷ÓÃ sudo ²»Ö´ÐÐÎÊÌâ

´úÂë
//µÚÒ»ÖÖ·½Ê½
exec($cmd,$str,$result);
echo "result = $result <br/>";
if ($result != 0) {
    echo "failed";
}
print_r($str);
#ûÓÐÊä³ö½á¹û
//µÚ¶þÖÖ·½Ê½
$output = shell_exec("/usr/bin/sudo /usr/bin/whoami 2>&1);
echo "output = $output";
#Êä³ö´íÎó
Ô­Òò
Defaults requiretty
¼üÈëÃüÁîvisudo,´ò¿ªsudoersÎļþ£¬±à¼­¸ÃÎļþ×¢Ê͵ôDefaults requirettyÒ»ÐУ¬²¢ÔÚÎļþĩβ׷¼ÓApache ALL=NOPASSWD:/bin/ps
apache ALL = (root) NOPASSWD: /usr/bin/whoami


Ïà¹ØÎĵµ£º

phpÎļþÉÏ´«´úÂë

<html>
<head><title>ÎļþÉÏ´«</title></head>
<body alink="#FF0000" link="#000099" vlink="#CC6600" topmargin="8" leftmargin="0" bgColor="#FFFFCC">
<?php
if(!$_POST['upload'])
{
?>
<form enctype="multipart/form-data" action="upload.php" method="post"& ......

PHPʵÏÖÀàËÆtailÃüÁî¶ÁÈ¡×îºónÐеķ½·¨

Ô­Îijö×Ô£º http://www.hly1980.cn/archives/118.html
ÐèÒª·ÖÎöÈÕ־ʱtailÃüÁî¿ÉÊdz£ÐèÒªÓõ½µÄ£¬¿ÉϧphpÄÚ²¢Ã»ÓÐÌṩÀàËƵķ½·¨£¬ËùÒÔ×Ô¼ºÊµÏÖÁËÒ»¸ö¡£
µ÷Ó÷½Ê½Îªtail($filename, $rows)£¬Ã¿´ÎĬÈ϶ÁÈ¡1024×Ö½Ú×÷Ϊ»º³å£¬·µ»Ø×Ö·û´®Êý×飬ÎļþβµÄÐп¿Ç°£¨ÕâÀïµÄÐÐΪºÍtailÓÐËùÇø±ð£¬Èç¹ûÐèÒªÒÔÔ­Ðò·µ»ØµÄÇë×ÔÐе÷ÓÃarr ......

PHP »·¾³ÅäÖÃ

PHP »·¾³ÅäÖÃ
PHP ¸ÅÊö
£º
PHPÊÇÓ¢Îij¬¼¶Îı¾Ô¤´¦ÀíÓïÑÔHypertext PreprocessorµÄËõд¡£PHP ÊÇÒ»ÖÖ HTML ÄÚǶʽµÄÓïÑÔ£¬ÊÇÒ»ÖÖÔÚ·þÎñÆ÷¶ËÖ´ÐеÄǶÈëHTMLÎĵµµÄ½Å±¾ÓïÑÔ£¬ÓïÑԵķç¸ñÓÐÀàËÆÓÚCÓïÑÔ£¬±»¹ã·ºµÄÔËÓá£
PHP ¹¦ÄÜ
£º
PHP ¶ÀÌصÄÓï·¨»ìºÏÁË C¡¢Java¡¢Perl ÒÔ¼° PHP ×Ô´´ÐµÄÓï·¨¡£Ëü¿ÉÒÔ±È CGI »òÕß Perl ¸ü¿ ......

javascript ת»»ÎªUNIXʱ¼ä´Á£¬PHP¿ÉÓÃ

//ת»»ÎªUNIXʱ¼ä´Á
function strtotimestamp(datestr)
{
    var new_str = datestr.replace(/:/g,"-");
    new_str = new_str.replace(/ /g,"-");
    var arr = new_str.split("-");
    var datum = new Date(Date. ......

PHPÓïÑÔ

    PHP£¬ÊÇÓ¢Îij¬¼¶Îı¾Ô¤´¦ÀíÓïÑÔHypertext PreprocessorµÄËõд¡£PHP ÊÇÒ»ÖÖ HTML ÄÚǶʽµÄÓïÑÔ£¬ÊÇÒ»ÖÖÔÚ·þÎñÆ÷¶ËÖ´ÐеÄǶÈëHTMLÎĵµµÄ½Å±¾ÓïÑÔ£¬ÓïÑԵķç¸ñÓÐÀàËÆÓÚCÓïÑÔ£¬±»¹ã·ºµÄÔËÓá£
    PHP ¶ÀÌصÄÓï·¨»ìºÏÁË C¡¢Java¡¢Perl ÒÔ¼° PHP ×Ô´´ÐµÄÓï·¨¡£Ëü¿ÉÒÔ±È CGI »òÕß Perl ¸ü¿ìË ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ