AV1611 Posted August 4, 2006 Share Posted August 4, 2006 OKI have linux (seems relevant LOL)if I do this from the command line:root# php myfile.phpit executes this fine:myfile.php<?phpexec(xmame romfile);?>and xmame launches fine.BUTif I run the same from the browser, it doesn't give an error, but doesn't run.QUESTION:Is is possible to launch a executable from the browser? or must I learn another language? (perl?)(My goal is to write a front end for xmame that uses the web browser, php and mysql) It would have to be run locally obviouslythanks Quote Link to comment https://forums.phpfreaks.com/topic/16549-exec/ Share on other sites More sharing options...
Ninjakreborn Posted August 4, 2006 Share Posted August 4, 2006 I don't understand when someone says command line, all I deal with is host based php/mysql programming, I never ran it from a straight server, as for exec, it should work, if not I think system()there about the same, the main thing is though don't feed user input into system it's dangerous. Quote Link to comment https://forums.phpfreaks.com/topic/16549-exec/#findComment-69208 Share on other sites More sharing options...
effigy Posted August 4, 2006 Share Posted August 4, 2006 php probably isn't in apache's path. Something simple like pwd should work:[code]<pre><?php exec('pwd', $output, $return); echo "Returned: $return<br /><br />"; if ($return) { echo 'There was a problem.'; } else { echo "Output:<br />"; print_r($output); }?></pre>[/code]Try replacing 'pwd' with 'env' to see your PATH. You can also try specifying the full path to php. Quote Link to comment https://forums.phpfreaks.com/topic/16549-exec/#findComment-69252 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.