Jump to content

Problem with popen, passthru, etc.


polpus

Recommended Posts

Hello,

 

I have a problem that I hope you can help me out with.

 

I have a file "a.out", which is a C++ program compiled with g++. I'm trying to execute that program from PHP and read the output, but to no avail.

 

This is my code:

 

$fp = popen("./a.out","r");
while (!feof($fp)) echo fgets($fp,1024);
pclose($fp);

 

I have tried replacing "./a.out" with "a.out", "/fullpath/to/a.out", etc... and nothing works.

 

Am I missing something or is it not possible to execute .out files from PHP?

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/100730-problem-with-popen-passthru-etc/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.