<p><br>
On Apr 8, 2012 9:13 AM, "Karl-Arne Gjersøyen" <<a href="mailto:karlarneg@gmail.com">karlarneg@gmail.com</a>> wrote:<br>
><br>
> Hello.<br>
> I am not sure this have to do with my Ubuntu server or it have to do<br>
> with the PHP installation.<br>
></p>
<p>Hello.  Your issue seems to be a file permission problem.</p>
<p>> When using file_put_contents() in PHP I got this error:<br>
> Warning: file_put_contents(3128a463470a06f833c9787fdf0c58dc.png)<br>
> [function.file-put-contents]: failed to open stream: Permission denied<br>
> in /home/test/public_html/cptcha.php on line 62<br>
><br>
> Here is the directory and the permittion on my server:<br>
><br>
> ls -l /<br>
> drwxr-xr-x   8 root root  4096 2012-04-08 13:30 home<br>
><br>
> ls -l /home/<br>
> drwxr-xr-x 4 test   test   4096 2012-04-08 13:31 test<br>
><br>
> ls -l /home/test/<br>
> drwxr-xr-x 2 test test 4096 2012-04-08 14:54 public_html<br>
><br>
> karl@ubuntu:~$ ls -l /home/test/public_html/<br>
> totalt 772<br>
> -rw-r--r-- 1 test test 778552 2012-04-08 13:58 arial.ttf<br>
> -rw-r-r-- 1 test test   1670 2012-04-08 14:54 cptcha.php<br>
> -rw-r--r-- 1 test test   1709 2012-04-08 14:43 spamTest.php<br>
> karl@ubuntu:~$<br>
></p>
<p>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 .</p>
<p>> Hope you can help me.<br>
> Thanks for your time!<br>
><br>
> Karl<br>
> --<br>
> Hjemmeside: <a href="http://www.karl-arne.name/">http://www.karl-arne.name/</a><br>
> Homepages: <a href="http://blog.karl-arne.name/">http://blog.karl-arne.name/</a><br>
></p>
<p>Hope this helps,<br>
-kyle</p>
<p>> --<br>
> ubuntu-server mailing list<br>
> <a href="mailto:ubuntu-server@lists.ubuntu.com">ubuntu-server@lists.ubuntu.com</a><br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-server">https://lists.ubuntu.com/mailman/listinfo/ubuntu-server</a><br>
> More info: <a href="https://wiki.ubuntu.com/ServerTeam">https://wiki.ubuntu.com/ServerTeam</a><br>
</p>