I'm trying to upload a file with an html/ php form. And I keep getting this error:
PHP Warning: move_uploaded_file(/var/www/html/envioDoc/archivosAlumnos/archivo-dni-): failed to open stream: Permission denied in /var/www/html/envioDoc/avisos-de-pago.php on line 45, referer: http://54.85.84.42/envioDoc/index.html
Line 45 in my php file is the move_uploaded_file() function.
So, I've done this at the command line on the server:
ps aux | grep httpd
The first column of the result is my logged in username: ubuntu
And after that:
sudo chown ubuntu /var/www/html/envioDoc/archivosAlumnos
chmod -R 0755 /var/www/html/envioDoc/archivosAlumnos
But the error kept appearing, so I've changed the perms to 0777.
Is that insecure? Why it didn't worked with 0755?