daydreamer Posted June 14, 2008 Share Posted June 14, 2008 I am running a Linux server (Ubuntu desktop, Apache, PHP5). I want to be able to run any linux commands from my PHP scripts. For example, this works: <?php $output = shell_exec('ls'); echo "<pre>$output</pre>"; ?> But I want to be able to do things like (example) : <?php shell_exec('gnome-open www.google.com'); ?> This opens a browser with google loaded if I do it manually from the command line. When I do it in a PHP script, it wont load the browser. (I am doing it locally). Why is this? Quote Link to comment https://forums.phpfreaks.com/topic/110203-running-linux-commands-through-php/ Share on other sites More sharing options...
.josh Posted June 14, 2008 Share Posted June 14, 2008 I really don't know squat about linux but my shot in the dark is...does php.exe have permission to access gnome? Quote Link to comment https://forums.phpfreaks.com/topic/110203-running-linux-commands-through-php/#findComment-565523 Share on other sites More sharing options...
daydreamer Posted June 14, 2008 Author Share Posted June 14, 2008 Yeh I was thinking the same thing, either Apache or PHP wont allow me to run commands because of security. But I dont know which settings to change, or where to find them! Im going to look into it.... if anybody knows what I should be doing to get it to run let me know (please) Quote Link to comment https://forums.phpfreaks.com/topic/110203-running-linux-commands-through-php/#findComment-565525 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.