Re: User when script uploads a file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can check the user name by having the following PHP script:

<?php echo `whoami`;

This may not work but it's worth a try. If it doesn't work you can try
finding the USER environment variable and echo that to find out whether
your users are the same.

Cheers
Tim
On 8/04/2015 9:31 am, "Jeffry Killen" <jekillen@xxxxxxxxxxx> wrote:

>
> On Apr 7, 2015, at 2:00 PM, Ryan Pallas wrote:
>
>  On Tue, Apr 7, 2015 at 2:51 PM, Jeffry Killen <jekillen@xxxxxxxxxxx>
>> wrote:
>>
>>  sorry I should have done reply all
>>>
>>>
>>> On Apr 7, 2015, at 1:03 PM, Ashley Sheridan wrote:
>>>
>>> On Tue, 2015-04-07 at 12:54 -0700, Jeffry Killen wrote:
>>>
>>>>
>>>>  Hi again;
>>>>>
>>>>> I have a CMS that I use locally for dev purposes.
>>>>>
>>>>> It has a facility for creating a sub directory with the name pattern:
>>>>> lab_#
>>>>>
>>>>> Within each lab_# are directories like lab_#/css, lab_#/js, lab_#/php,
>>>>> So I want to upload a file into dev_labs/lab_8/php and the php dir
>>>>> has permissions set to 0755 ( web server user is the owner because
>>>>> a php script created the dir and sub dirs).
>>>>>
>>>>> Uploading to the target dir fails with the error write permission
>>>>> denied.
>>>>>
>>>>> So when a file is uploaded via a php script  who is the user? (in
>>>>> Apache on MacOSX, or any version of a unix system)
>>>>>
>>>>> Thanks in advance for info
>>>>> JK
>>>>>
>>>>>
>>>>>
>>> To overload this thread, I have another issue at hand:
>>> I thought that ZipArchive is a built-in class. At least that is the
>>> implication of the manual.
>>> But when I do $_zipper = new ZipArchive (as in below), I get a fatal
>>> error: class ZipArchive not found.
>>> Fatal error: Class 'ZipArchive' not found in /path/dev_lab/lab_8/php/
>>> archiver.php
>>> on line 14
>>> class _ARCHIVER
>>>     {
>>>      private static $_class = '';
>>>      private static $_zipper = '';
>>>
>>>      public function __construct()
>>>             {
>>>              self::$_class = get_class($this);
>>>              self::$_zipper = new ZipArchive; // << fatal error
>>>             }
>>>       // ...etc....
>>>      }
>>>
>>>  You'll want to check the manual again,
>> http://php.net/manual/en/zip.installation.php you need to compile php to
>> have it on Linux and use the extension= directive in php.ini for windows.
>>
>>  Thanks for time and attention
>>> JK
>>>
>>>
> Looking at phpinfo() for this serve, you're right it isn't compiled in. I
> was
> just looking at the manu specific to ZipArchive and not the
> zip.installation part
> I have another local server that does have it compiled in.
>
> Muchas gracias.
> JK
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux