I'm new to ColdFusion so please forgive me if I'm asking an obvious question.
I'm trying to run a simple code, which I've found somewhere to test if cfexecute works or not.
<cfexecute name="netstat" variable="result" timeout=10 />
<cfdump var="#result#">
The above code return [empty string], or if I try to write it into a file it just creates an empty file.
I've also tried to ping a server, what I can do from command line.
What I've noticed is that the page gets generated immediately instead of waiting for the timeout in case it would fail.
Also what is important to note: the code works sometimes, without changing anything.
Is it possible that there is a limitation on how many programs can ColdFusion execute?
Thanks for the help!
Solution: I had too many executions that did not terminate themselves automatically. That did not allow ColdFusion to open a new one.
答案 0 :(得分:0)
问题是由于timeout
值较低。执行netstat
命令需要时间。尝试将其增加到100或更多。我也遇到过同样的问题。增加超时值可以解决问题。
注意:@beginner建议您需要提供要执行的可执行文件的绝对路径,以防路径未添加到您的环境变量或默认应用程序文件夹(默认情况下os查找文件)。 如果路径在环境变量或应用程序文件夹中可用,您也可以提供名称。