php-general Digest 22 Mar 2011 10:45:42 -0000 Issue 7237

Topics (messages 311980 through 311983):

Re: Question about directory permissions
        311980 by: Andy McKenzie
        311981 by: Curtis Maurand

SSL issues
        311982 by: Bostjan Skufca
        311983 by: Richard Quadling

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Sure.  The script runs with the permissions of whoever is running it.

In general, a PHP script that's a web page in linux will run by a user
called something like apache, apache2, www-user, or something similar.
 If you give that user permissions -- either directly or through their
group, often of the same name -- to write to the directory in
question, then the script will be able to write to it.

For instance:  on my Ubuntu 10.04 server, I want my script DW3 to be
able to write to /var/www/DW3/logs.  I leave ownership of everything
else as it was, and do the following:

$ cd /var/www/DW3
$ chgrp www-data ./logs
$ chmod 770 ./logs

Now members of the group www-data (at the moment only apache) can
write to the directory, as can the owner, but no one else can.  In
reality, I could probably have set that to 660, but I don't much care
about the slight added risk of using 770 in this case.  (If you're
confused by the numbers I used, check here:
http://www.yolinux.com/TUTORIALS/LinuxTutorialManagingGroups.html)


I hope that helps!

-Andy

On Mon, Mar 21, 2011 at 1:58 PM, Al <n...@ridersite.org> wrote:
> I understand dir perms pretty well; but, have a question I can't readily
> find the answer to.
>
> Under a Linux system, scripts can't write, copy, etc. to other dirs unless
> the perms are set for writable for the script e.g., nobody.
>
> But, is there a way a script can write or copy within its own dir?
>
> Thanks...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---

Al wrote:
> I understand dir perms pretty well; but, have a
question I can't readily
> find
> the answer to.
>

> Under a Linux system, scripts can't write, copy, etc. to other
dirs unless
> the
> perms are set for writable for the
script e.g., nobody.
> 
> But, is there a way a script can
write or copy within its own dir?
>
Not unless it has
permission to do so.  Most likely, however, it can write to the temp
space such as /tmp or /var/tmp.

--Curtis

--- End Message ---
--- Begin Message ---
Hi all,

is anyone else experiencing SSL connectivity issues with PHP 5.3(.5|6)?
PHP 5.2.17 compiled identically on the same system with the same
config file connects to remote SSL-enabled host just fine, whereas PHP
5.3 (only tried .5 and .6) does not. Error message:

Warning: stream_socket_client(): SSL operation failed with code 1.
OpenSSL Error messages:
error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert
unexpected message
Warning: stream_socket_client(): Failed to enable crypto

Any ideas why this is happening?

Thanks,
b.

PS: With all the best efforts towards ditching PHP 5.2 this is a real
showstopper.

--- End Message ---
--- Begin Message ---
On 22 March 2011 01:21, Bostjan Skufca <bost...@a2o.si> wrote:
> Hi all,
>
> is anyone else experiencing SSL connectivity issues with PHP 5.3(.5|6)?
> PHP 5.2.17 compiled identically on the same system with the same
> config file connects to remote SSL-enabled host just fine, whereas PHP
> 5.3 (only tried .5 and .6) does not. Error message:
>
> Warning: stream_socket_client(): SSL operation failed with code 1.
> OpenSSL Error messages:
> error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert
> unexpected message
> Warning: stream_socket_client(): Failed to enable crypto
>
> Any ideas why this is happening?
>
> Thanks,
> b.
>
> PS: With all the best efforts towards ditching PHP 5.2 this is a real
> showstopper.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I'm on Windows. Using 5-3-7-dev (my own build with php_openssl
statically built rather than as a shared extension).

php -d error_reporting=-1 -d display_errors=1 -r "echo
file_get_contents('https://mail.google.com/mail');"

and I get the correct content and no errors.

Can you try the above command?

Richard.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---

Reply via email to