system() & exec()

system()
The system() call also tries to automatically flush the web server’s output buffer after each line of output if PHP is running as a server module.
exec()
則不會flush

遇到的問題是
我的php 透過perl 去執行一些功能
然後perl 回傳 success or false 字串 在standard output 上
php再去get 這個字串
success 則print success
給 ajax 來判斷

結果 在前端的ajax 一直印出 successsuccess
的字眼
想說怎麼會印兩次….
看了一下手冊才發現這個

之前就想說 php 幹麻沒事有兩個 執行CLI 的東西……
仔細看了一下手冊才知道
筆記一下..

About johnpupu

..........
This entry was posted in program and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word