implet Posted January 11, 2009 Share Posted January 11, 2009 heya i'm want to execute a program in the shell using php. this is what happens in the shell and what I want to do in php: ben@ben-laptop:~$ cd /usr/local/sage-3.2.1 && ./sage ---------------------------------------------------------------------- | Sage Version 3.2.1, Release Date: 2008-12-01 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: 1+2 3 i've tried this: exec("cd /usr/local/sage-3.2.1 && ./sage",$s); echo shell_exec("3+4"); print_r($s); it outputs: Array ( [0] => ---------------------------------------------------------------------- [1] => | Sage Version 3.2.1, Release Date: 2008-12-01 | [2] => | Type notebook() for the GUI, and license() for information. | [3] => ---------------------------------------------------------------------- [4] => ********************************************************************** [5] => Welcome to IPython. I will try to create a personal configuration directory [6] => where you can customize many aspects of IPython's functionality in: [7] => [8] => /root/.sage/ipython [9] => Initializing from configuration /usr/local/sage-3.2.1/local/lib/python2.5/site-packages/IPython/UserConfig [10] => Please press to start IPython. [11] => ********************************************************************** ) how can i output what i did in the shell to the browser? thanks Link to comment https://forums.phpfreaks.com/topic/140372-phplinux-interaction-via-shell/ Share on other sites More sharing options...
ratcateme Posted January 11, 2009 Share Posted January 11, 2009 i think you are looking for pfsockopen() i used it once a while ago Scott. Link to comment https://forums.phpfreaks.com/topic/140372-phplinux-interaction-via-shell/#findComment-734578 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.