Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将变量记录到文件似乎不起作用,但没有例外_Php_Multidimensional Array_Error Logging - Fatal编程技术网

Php 将变量记录到文件似乎不起作用,但没有例外

Php 将变量记录到文件似乎不起作用,但没有例外,php,multidimensional-array,error-logging,Php,Multidimensional Array,Error Logging,我试图打印出一个多层数组,这样我就可以看到传递了什么信息,也许可以添加一些东西 我尝试使用foreach,但根据请求有太多不同的级别 还有html文本妨碍我通过简单打印读取输出。\r 我复制了一个正常工作的异常日志记录部分并对其进行了编辑。由于某种原因,它不起作用。 我还创建了要写入的文件和文件夹。 我没有发现任何表明存在错误的错误日志 脚本在此部分之后继续执行 我还尝试了“error_log”函数,但也没有找到该文件这里我在./var/log/下进行了检查,而不是在source/log/下进行

我试图打印出一个多层数组,这样我就可以看到传递了什么信息,也许可以添加一些东西
我尝试使用foreach,但根据请求有太多不同的级别
还有html文本妨碍我通过简单打印读取输出。\r
我复制了一个正常工作的异常日志记录部分并对其进行了编辑。由于某种原因,它不起作用。
我还创建了要写入的文件和文件夹。
我没有发现任何表明存在错误的错误日志
脚本在此部分之后继续执行
我还尝试了“error_log”函数,但也没有找到该文件
这里我在./var/log/下进行了检查,而不是在source/log/下进行转储。
我还检查了其他负载平衡服务器

代码:

    $sOfferId = $aArticle['ggebayofferid'];

    $aBody = $this->createOfferItem($aArticle);
    print_r("\n abody: ".$aBody." \n");  //<- this shows me that the execution is reaching here
    $sDump = "\n";
    $sDump .= $aBody;
    file_put_contents( "log/ebayupdate.log", $sDump, FILE_APPEND );  //<-- not able to find this log
    $sURL = $this->_sURL.'/sell/inventory/v1/offer/'.$sOfferId;
    //error_log( print_r($aBody, TRUE) );  <-- not able to find this log
$sOfferId=$aArticle['ggebayofferid'];
$aBody=$this->createOfferItem($aArticle);

打印(“\n abody:.$abody.\n”)//1.尝试使用绝对路径;2.检查
file\u put\u contents的返回值
您尝试将数组放入文件不好的想法尝试
echo';var_dump($aBody);回声'1$path=$this->\u sShopBasePath。“/log/ebayupdate.log”;这是可行的,它只向文件写入单词数组当然…-。-但是第二。我得到回报value@AramMnatsakanyan这就是我要找的输出,谢谢^^如果你在浏览器中转储你的html代码必须像html内容一样显示,你可以尝试在cmd中运行该脚本以查看html代码