简体   繁体   中英

Redirecting php script adding log file size

I have the below php script which just assigns a variable. When I run the script from unix command prompt test.log file that is created has 1 byte. It should be zero byte. Not sure how the new line gets added. How to prevent it so that test.log file has zero byte.

test.php

<?php

$dir = "/usr/local/test";

?>

/usr/bin/php /usr/local/src/test.php >> /usr/local/log/test.log 2>&1

尝试从php文件itselt中删除所有所有新行,请记住php分析器将仅尝试运行文件中end标签中嵌入的内容,这样您就可以告诉它从open标签到末尾的所有内容文件是php代码,不应将其解析为纯文本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM