0
當我嘗試運行這個php腳本時,我在ssh中得到了以下響應......它在php 5.2下正常工作,現在已安裝5.3,我遇到了麻煩。我看不出什麼是錯的。PHP腳本現在在PHP 5.3下接收錯誤?
的錯誤:
線1:PHP:沒有這樣的文件或目錄
線2:鄰近意外的標記'0'
線2語法錯誤:`參數或者set_time_limit(0); 「
這是腳本。
<?php
set_time_limit(0) ;
$arr = explode("/",$_SERVER['SCRIPT_FILENAME']);
$ct = count($arr);
unset($arr[$ct-1]);
$path=implode("/",$arr);
$path=$path."/";
if(is_file($path."state.txt"))
{
$lines = file($path."state.txt");
if($lines)
{
foreach($lines as $line)
{
if($line)
{
$state = trim($line);
if(!is_dir($path.$state))
{
@mkdir($path.$state,0777);
if(is_file($path."copieble/state/index.php"))
{
$from = $path."copieble/state/index.php";
$to = $path.$state."/index.php";
@copy($from,$to);
}
}
}
}
}
}
@chdir($path);
$handle=opendir('.');
while (($file = readdir($handle))!==false)
{
@chdir($path);
if (($file != ".") && ($file != ".."))
{
if(is_dir($file) && $file != "copieble" && $file !="_vti_cnf")
{
if(is_file($path.$file.".txt"))
{
$lines = file($path.$file.".txt");
if($lines)
{
foreach($lines as $line)
{
if($line)
{
$city = trim($line);
@chdir($path.$file);
if(!is_dir($city))
{
@mkdir($city,0777);
if(is_file($path."copieble/city/index.php"))
{
$from = $path."copieble/city/index.php";
$to = $path.$file."/".$city."/index.php";
@copy($from,$to);
}
}
}
}
}
}
}
}
}
closedir($handle);
include("reflect_changes.php");
?>
lol忘了所有關於在shell中首先使用該php ...但現在我得到'無法打開輸入文件'... – user756659
瞭解它 - 感謝指出愚蠢的錯誤...必須更多睡眠比我想象的要多! – user756659