polpus Posted April 11, 2008 Share Posted April 11, 2008 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 More sharing options...
discomatt Posted April 11, 2008 Share Posted April 11, 2008 I don't believe it's an issue with PHP, but your OS. If your os can't execute .out files, then they will not be executed. Link to comment https://forums.phpfreaks.com/topic/100730-problem-with-popen-passthru-etc/#findComment-515204 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.