Re: can't print, it it because no posix login?
| From: | Ron Scott | Date: | Wed, 04 Oct 2000 21:40:57 +0000 |
| Subject: | Re: can't print, it it because no posix login? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18660@lists.php.net to get a copy of this message | ||
Today Mailing List Mailbox wrote:
> Trying to print from within PHP is giving this error:
>
> lpr: cannot create /var/spool/lpd/lj4050/.seq
>
> I've manually tested to make sure the user/group that the webserver is
> running under can print so I'm not quite sure why when I try to do it from
> PHP I get such an error. I tried to test what user PHP thought it was
> printing as and the UID/GID are correct but no login name seems to
> exist. Could this be the cause?
>
> <?
> $uid = posix_getuid();
> $euid = posix_geteuid();
> $gid = posix_getgid();
> $egid = posix_getegid();
> $login = posix_getlogin();
> echo "<B>$login</B> <I>UID: $uid ($euid) GID: $gid
> ($egid)</I>";
> ?>
>
> This lil code chunk returns:
>
> Warning: Cannot determine your login name. Something is really wrong
> here. in /home/httpd/html/test/posix_getlogin.php on line 7
> UID: 99 (99) GID: 99 (99)
>
>
> Anyone know why this is?
Perhaps the user with uid 99 (who runs the webserver)
has no valid login shell.
-Ron
--
UNIX was never designed to keep people from doing stupid things, because
that policy would also keep them from doing clever things. (Doug Gwyn)