当我在Ubunutu中运行一个.php脚本时,怎么来只是回到脚本呢?
发布时间:2020-05-27 07:59:11 所属栏目:PHP 来源:互联网
导读:我必须解码我命名为cache.log的我的一个Chrome缓存文件的二进制内容数据.我要解码的方式是使用我在这里找到的php脚本 http://www.frozax.com/blog/2011/05/recover-file-google-chrome-cache-gzipped/ 我已经安装了以下命令的php sudo apt-get install php5 l
|
我必须解码我命名为cache.log的我的一个Chrome缓存文件的二进制内容数据.我要解码的方式是使用我在这里找到的php脚本 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脚本时,我在Terminal中得到以下内容 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;
正如你所看到的,它正在做的是回应脚本. 如何实际运行脚本? 它看起来不像代码包裹在:<?php ?> 如果没有,它将只是回声而不是执行.这样做的原因是PHP可以将服务器脚本和HTML混合在同一个文件中. <html>
<head><title></title></head>
<body>
<?php
//Inside the php block so it gets executed and prints 'Hello World'
echo "Hello,World!";
?>
<!--Outside the php block so it just gets echoed and prints 'echo "Hello,World!";' -->
echo "Hello,World!";
</body>
</html> (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
