Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- From: r0g <aioe.org@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Sep 2008 06:18:47 -0400
Richard wrote:
"r0g" <aioe.org@xxxxxxxxxxxxxxxxxx> wrote in message
news:gapi3a$efa$1@xxxxxxxxxxx
Álvaro G. Vicario wrote:
*** r0g escribió/wrote (Tue, 16 Sep 2008 08:51:39 -0400):Hi escribió, thanks for the reply but I don't think I made it clear
<?php print exec('nautilus /var/www'); ?>You can't open server programs in remote clients via HTTP. Often,
...actually prints: "Run 'nautilus --help' to see a full list of
available command line options." in my browser!
they
don't even run the same OS. All you can do is running programs *in
the
server* and capture their text output.
enough. While I understand remote/public servers go to great lengths
to
avoid people using/abusing apache to startup random programs the
machine
in question here is a _local_ development machine. It is running
Ubuntu
8.04 with the standard Gnome desktop, Apache/2.2.8 (Ubuntu)
PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch.
The application serves up locally generated pages and needs to run
commands to startup various local applications, such as file
browsers
and FTP programs.
As I explained, I had this working fine in Windows using the exec()
command on a WAMP stack (Wamp5), so I think the problem is likely to
be
permission based, having just switched to linux, but I'm not sure.
Anyone?
Thanks,
Correct,
in Ubuntu the webserver runs as a different user account than the
logged in user.
If you would start it manually (as a user, not as a background
service) you can probably do the same as on windows.
You can change the user account the webserver runs under, this will
probably make your setup work immediately.
But be careful, this will also give all outside users the same
permission as this user!
If you keep it strictly local as you say, that should be no problem
though.
WAMP runs Apache and mySQL as a user program, not as a service.
The stand-alone Apache install runs (used to run??) as the system
account if used as a service.
(I still see it as a major flaw in the Apache installers that it is
installed as system account by default. )
That means that many things just work, where things will just not work
in antoher OS because of permissions.
Richard
Thanks for your reply Richard,
I've just been looking into changing the webserver account permissions
and, given my newness to linux, it looks like a bit of a nightmare.
Indeed doing this even on a local/private machine makes my skin crawl a
bit! So...
I'm going to try a different tack and write a small daemon in python
that runs as me and launches programs from a predefined set in response
to a datagram poke via a local socket. This should be safer, less hassle
and more fun to write than those :-)
Thanks again,
Roger Heathcote.
.
- Follow-Ups:
- Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- From: C. (http://symcbean.blogspot.com/)
- Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- References:
- Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- From: r0g
- Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- From: Álvaro G. Vicario
- Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- From: r0g
- Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- From: Richard
- Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- Prev by Date: Re: Why does my class require the public accessor for my member?
- Next by Date: Re: how to extract part of HTML page
- Previous by thread: Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- Next by thread: Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.
- Index(es):
Relevant Pages
|