Re: getting php to run as another user?

From: coolsti (coo_at_goontrytospamme.com)
Date: 09/24/04


Date: Fri, 24 Sep 2004 18:08:53 +0200

Hi NC,

thanks for your response. Here is some more information:

> OK, but what is the nature of the network connection between the two
> machines?

Both machines are on the company intranet. I administer the Linux machine
which is where the PHP script lies. I can currently mount the target
Windows drive using smbmount from the Linux machine. Currently I do this
with my own Windows user ID. In about a month the Windows machine will be
upgraded to Windows 2003, meaning I no longer can use smbmount, but need
to use CIFS instead. But this is no problem, I have successfully done a
mount in this way to another drive running from Windows 2003. To do this,
I had to patch and rebuild my Redhat 8 kernel, but that went smoothly.

So I can "see" the windows drive as just a directory on my Linux system.
But when I try this by uploading a file with my php script, the script is
not allowed to move the file to the target directory on the windows
machine. I get this error:

Warning: Unable to create '/mnt/home/windrive/testfile.html':
Permission denied

where in this case the drive "windrive" has been successfully mounted on
my Linux machine. From a terminal window I myself can place (copy or move)
files from the Linux machine to this drive. But I can't get the PHP script
to do it.

I assume the reason is because PHP is running as user "apache" and apache
does not have write permissions on the windows drive. The new user
"george" will have write permissions.

So what do I need to do? The user "george" will have permission to write
to the Windows drive, and both PHP and apache run as user "apache". The
drive itself will be mounted with "george" as the windows user using
smbmount or CIFS, and in this case when mounting, the windows password of
"george" will be supplied.

Can anyone help?

Regards,
Steve, Denmark



Relevant Pages

  • Problem with Ad-hoc wireless network Windows to Linux (no ping)
    ... I am trying to set up an ad-hoc wireless network between two ... After I have set them up I cannot ping the Linux machine from the ... Windows machine. ... I get no reports of connection problems. ...
    (comp.os.linux.networking)
  • Re: OT: Why PC is evil
    ... what.....you're one of those Mac snobs? ... Building a Linux machine takes little patience. ... If it weren't for my job, I'd never use Windows again, and I wouldn't ... Joe - Linux User #449481/Ubuntu User #19733 ...
    (alt.smokers.cigars)
  • Re: using linux with windows internet connection sharing
    ... The last line shows that all packets that aren't destined for the ... packets from the Linux machine to the wide Net and vice versa. ... and pinging the windows machine works OK. ... This is *probably* a Windows problem. ...
    (comp.os.linux.misc)
  • Re: starting embedded linux debugging
    ... > some Windows CAD programs on a Linux machine. ... > exactly as if the host was running the embedded OS. ... world a lot of tools are fixed on Windows - things like CPLD ... > it's effectively connected to the network. ...
    (comp.os.linux.embedded)