为什么我的PHP exec()在bash tidy命令上打开文件?

时间:2015-11-19 20:54:03

标签: php wget tidy

请耐心等待我(我只是学习如何使用php)。我无法弄清楚我的tidy错误是否与错误的wget命令或其本身有关。我以为我的wget命令是抓取远程文件并将其放入我服务器上的$ link目录中...但似乎有些不对劲。

我试过

  • 将$ tidy_cmd更改为单引号
  • 将该行连接到"..." . $htmlDir . "/*";
  • 不包括" / *"
  • 使用php tidy命令(注释掉...失败)。

错误:

  

错误:无法打开" app / HtmlPages / arl.server.com -2015_11_19_15:36:09 / arl.server.com / index.php / art"

wget.php:

    $ip = $argv[1];

    // Get the current time for the filename
    $currentTime = date( 'Y_m_d_H:i:s' );
    $link = "app/HtmlPages/$ip" ."-". "$currentTime";             
    $htmlDir = "$link/$ip/index.php/art";

    // Use wget to download aaron.htm webpage
    $wget_cmd = "wget -P $link/ http://$ip/index.php/art/aaron.htm";

    exec ( $wget_cmd );

    // Clean up the HTML for every page.
    $tidy_cmd = "tidy -config tidy_config.txt -i -m $htmlDir/*";
    exec ( $tidy_cmd );

    //$tidy_config = file_get_contents( 'tidy_config.txt' );
    //$tidy = new tidy();
    //$tidy->parseFile( '$htmlDir/*.htm', $tidy_config );
    ...

0 个答案:

没有答案