naomik Posted September 4, 2009 Share Posted September 4, 2009 I'm trying to call a program (hbplus) from the command line. When I run the program directly from the command line, it executes successfully. When I run the program using the script below, I get a segmentation fault. Any ideas why? <?php echo '<pre>'; $last_line = system('./hbplus', $retval); // Printing additional info echo ' </pre> <hr />Last line of the output: ' . $last_line . ' <hr />Return value: ' . $retval; ?> Quote Link to comment Share on other sites More sharing options...
corbin Posted September 4, 2009 Share Posted September 4, 2009 Do you happen to have the code of the C program? Quote Link to comment Share on other sites More sharing options...
naomik Posted September 6, 2009 Author Share Posted September 6, 2009 I have it. It's not open source, but it's widely used. You have to write a professor to download it. http://www.biochem.ucl.ac.uk/bsm/hbplus/home.html Quote Link to comment Share on other sites More sharing options...
naomik Posted September 6, 2009 Author Share Posted September 6, 2009 I added to code to my script so that the console output was saved, and I got the following output: -bash-4.0$ cat hboutput ./hbplus: /lib/libc.so.6: version `GLIBC_2.7' not found (required by ./hbplus) When I run my program from the command line as shown, it executes succesfully. -bash-4.0$ ./hbplus 1PEF.pdb My php script: <?php echo '<pre>'; // Outputs all the result of shellcommand "ls", and returns // the last output line into $last_line. Stores the return value // of the shell command in $retval. $last_line = system('./hbplus 1PEF.pdb &>hboutput', $retval); // Printing additional info echo ' </pre> <hr />Last line of the output: ' . $last_line . ' <hr />Return value: ' . $retval; ?> Quote Link to comment Share on other sites More sharing options...
naomik Posted September 30, 2009 Author Share Posted September 30, 2009 See http://www.phpfreaks.com/forums/index.php/topic,271012.0.html for resolution. Quote Link to comment Share on other sites More sharing options...
Maq Posted September 30, 2009 Share Posted September 30, 2009 Please don't double post, it just wastes time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.