note 3549 deleted from mysql_connect by ronabop
| From: | ronabop@php.net | Date: | Sat, 12 Aug 2000 22:41:28 +0000 |
| Subject: | note 3549 deleted from mysql_connect by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1722@lists.php.net to get a copy of this message | ||
As someone stated before:
<PRE>
>Other people with an account on the system where you store your php
>file can see your password to the MySQL database by simply looking at
>your php file. I cannot figure out a way to avoid this because in
>order to post your php page on the Web, you have to give other
>people the read access to you file. Can anybody help me solving this >problem?
</PRE>
The reply was:
<PRE>
>In answer to the above, what I do on my system is make the php file
>750 (-rwxr-x---) and make myself the file owner, and the file's group
>be the group of the user that the web server runs as. Then you can
>do anything w/ the file, and other people can only view it through the
>webserver. How secure that is, kinda depends on what group your
>webserver runs as, etc, but it gives you an idea.
</PRE>
Unfortunately both chown and chgrp require root permissions to change the ownership/group of a file
to a group of which you're not a member. You'd be defeating the purpose of this attempt
if you're a member of the web server's group (as most other users would be as well). Is
there any way to do this when you don't have root access? Is there a better way of doing this?