1

I am trying to display ngspice output via PHP.

I am able to display the terminal output but i am unable to display the graph. I get an error saying:

"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 "

THis is my netlist file:

*ngspice netlist* 

v1 1 0 dc 5v

r1 1 0 1k

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

.control 

run 

plot allv 

.endc 

.end 

When this executed separately on terminals gives graph but I am unable to display graph via PHP. I run this code in HP by this code:

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

Unheilig
  • 16,196
  • 193
  • 68
  • 98

1 Answers1

0

ngspice seems to not have a connection to an output display and/or X-server.

Is there any error/warning message just after starting ngspice?

There is a lot of comments at http://php.net/manual/en/function.shell-exec.php about what might happen when you start a program by shell_exec (e.g. missing PATH entries ...).

Holger
  • 41
  • 3