PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm using Ubuntu 11.04 Desktop, I just installed LAMP on it because I'm going to use this as my test web server. I have problem on uploading file (usually .jpg) using PHP, file appears to be uploaded successfully but when i try to view my "upload" folder file isn't there. I modified the document root location in apache2 it is "/home/guesthere/php_practice" and the "upload" folder is a sub-folder of php_practice. Here's my code:
On your first question: how am I going to do that? Do I have to make another group name "apache"? or use the www-data? which I think the default user after installing apache. What command should i invoke? please guide really need your help it's my first time of doing this... btw here is the result after ll command.
drwxrwxrwx 3 guesthere guesthere 4096 2011-10-18 13:38 php_practice/
Error log
[Tue Oct 18 13:39:08 2011] [error] [client 127.0.0.1] PHP Warning: move_uploaded_file(): Unable to move '/tmp/php2pyHbG' to 'upload/' in /home/guesthere/php_practice/Pupload.php on line 12, referer: http://localhost/index.html
Your reply is very much appreciated... Thanks in advance...
No need to create a new group. Either chown /home/guesthere/php_practice/upload so www-data is its group, or chmod 777 to make it world writable. Based on the apache error, I'm guessing it's a permissions issue.
Also, while I suppose it isn't so important on your personal test machine, I wouldn't leave /home/guesthere/php_practice world writable.