为什么当我在Ubunutu中运行.php脚本时,它只会与脚本本身相呼应?
我必须解码我命名的Chrome缓存文件之一的二进制内容数据。我试图解码它的方式是使用我在这里找到的php脚本cache.log
http://www.frozax.com/blog/2011/05/recover-file-google-chrome-cache-gzipped/
我已经用以下命令安装了php
sudo apt-get install php5 libapache2-mod-php5
sudo apt-get install php5-cgi
当我尝试运行脚本时,我在终端中得到以下结果index1.php
s3z@s3z-laptop:~/Desktop$ php index1.php
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
// cache.log is a copy of chrome cache page with only the file content section
$cacheString = file_get_contents("cache.log");
$matches = array();
preg_match_all('/\s[0-9a-f]{2}\s/', $cacheString, $matches);
$f = fopen("t.bin","wb");
foreach ($matches[0] as $match)
{
fwrite($f,chr(hexdec($match)));
}
fclose($f);
ob_start();
readgzfile("t.bin");
$decoded_data=ob_get_clean();
echo $decoded_data;
如您所见,它所做的只是回显脚本。
如何实际运行脚本?