Re: Can't launch graphical apps from php exec() on Ubuntu 8.04 system.



On 17 Sep, 11:18, r0g <aioe....@xxxxxxxxxxxxxxxxxx> wrote:
Richard wrote:
"r0g" <aioe....@xxxxxxxxxxxxxxxxxx> wrote in message
news:gapi3a$efa$1@xxxxxxxxxxx
Álvaro G. Vicario wrote:
*** r0g escribió/wrote (Tue, 16 Sep 2008 08:51:39 -0400):
<?php print exec('nautilus /var/www'); ?>

...actually prints: "Run 'nautilus --help' to see a full list of
available command line options." in my browser!
You can't open server programs in remote clients via HTTP. Often,
they
don't even run the same OS. All you can do is running programs *in
the
server* and capture their text output.

Hi escribió, thanks for the reply but I don't think I made it clear
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.

Something wrong with writing a daemon in PHP?

C.
.



Relevant Pages

  • RE: Event ID: 32090 Faxing to Multiple recipients or a Group
    ... The incorrect permission settings may cause fax issues, ... If server is a DC, please modify the policy in Default Domain ... > Printer Spooler service is using Local System account. ... access Add/Remove Programs to reinstall it. ...
    (microsoft.public.windows.server.sbs)
  • RE: Event ID: 32090 Faxing to Multiple recipients or a Group
    ... The incorrect permission settings may cause fax issues, ... If server is a DC, please modify the policy in Default Domain ... >> Printer Spooler service is using Local System account. ... Please check the FAX Printer security settings and make sure that it ...
    (microsoft.public.windows.server.sbs)
  • Re: Cant launch graphical apps from php exec() on Ubuntu 8.04 system.
    ... You can't open server programs in remote clients via HTTP. ... command on a WAMP stack, so I think the problem is likely to ... permission based, having just switched to linux, but I'm not sure. ... You can change the user account the webserver runs under, ...
    (comp.lang.php)
  • RE: Event ID: 32090 Faxing to Multiple recipients or a Group
    ... I've done all except the non-services reboot, ... Tonight i've got a window of opportunity to reboot this server so i'll try ... The incorrect permission settings may cause fax issues, ... >>> Printer Spooler service is using Local System account. ...
    (microsoft.public.windows.server.sbs)
  • Re: Event ID: 32090 Faxing to Multiple recipients or a Group
    ... Tonight i've got a window of opportunity to reboot this server so i'll ... The incorrect permission settings may cause fax issues, ... please assigned Full permissions for NETWORK SERVICE ACCOUNT ...
    (microsoft.public.windows.server.sbs)