2015-11-10 64 views
1

我想通過PHP顯示ngspice輸出。ngspice結果顯示通過PHP

我能夠顯示終端輸出,但我無法顯示圖形。我得到一個錯誤說:

"ERROR: (internal) This operation is not defined for display type printf. Can't open viewport for graphics. Note: No ".plot", ".print", or ".fourier" lines; no simulations run "

這是我的網表文件:

*ngspice netlist* 

v1 1 0 dc 5v 

r1 1 0 1k 

.tran 1e-03 11e-03 1e-03 

.control 

run 

plot allv 

.endc 

.end 

當這個終端上單獨執行給圖形,但我無法通過PHP來顯示圖形。我使用此代碼在HP中運行此代碼:

$ output = shell_exec('ngspice /var/www/html/eSIM/netlist.txt 2> & 1');

回答

0

ngspice似乎沒有連接到輸出顯示和/或X服務器。

啓動ngspice後是否有任何錯誤/警告消息?

http://php.net/manual/en/function.shell-exec.php上有很多評論,關於當您通過shell_exec啓動程序時可能發生的情況(例如,缺少PATH條目...)。