Permission Denied

Kyle Johnson kjohnson at fixertec.net
Sun Apr 8 13:44:47 UTC 2012


On Apr 8, 2012 9:13 AM, "Karl-Arne Gjersøyen" <karlarneg at gmail.com> wrote:
>
> Hello.
> I am not sure this have to do with my Ubuntu server or it have to do
> with the PHP installation.
>

Hello.  Your issue seems to be a file permission problem.

> When using file_put_contents() in PHP I got this error:
> Warning: file_put_contents(3128a463470a06f833c9787fdf0c58dc.png)
> [function.file-put-contents]: failed to open stream: Permission denied
> in /home/test/public_html/cptcha.php on line 62
>
> Here is the directory and the permittion on my server:
>
> ls -l /
> drwxr-xr-x   8 root root  4096 2012-04-08 13:30 home
>
> ls -l /home/
> drwxr-xr-x 4 test   test   4096 2012-04-08 13:31 test
>
> ls -l /home/test/
> drwxr-xr-x 2 test test 4096 2012-04-08 14:54 public_html
>
> karl at ubuntu:~$ ls -l /home/test/public_html/
> totalt 772
> -rw-r--r-- 1 test test 778552 2012-04-08 13:58 arial.ttf
> -rw-r-r-- 1 test test   1670 2012-04-08 14:54 cptcha.php
> -rw-r--r-- 1 test test   1709 2012-04-08 14:43 spamTest.php
> karl at ubuntu:~$
>

Webservers, on Ubuntu, usually run as the www-data user.  Either chown this
directory to www-data, or make the permissions more open by letting "other"
write:  chmod o+wx .

> Hope you can help me.
> Thanks for your time!
>
> Karl
> --
> Hjemmeside: http://www.karl-arne.name/
> Homepages: http://blog.karl-arne.name/
>

Hope this helps,
-kyle

> --
> ubuntu-server mailing list
> ubuntu-server at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
> More info: https://wiki.ubuntu.com/ServerTeam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-server/attachments/20120408/bd2e7920/attachment.html>


More information about the ubuntu-server mailing list