in question here is not so much in the programming (which is why I’ve not posted all the code) but in the configuration or possibly in the new versions of PHP.
The file is checked for being valid and in the proper format but I think the issue is not in all that but rather than the file isn’t being created in the /tmp folder even though that’s not what the actual error says. This is the bit that does the uploading.
if (move_uploaded_file($_FILES['UploadFile']['tmp_name'], $target_file)) :
$Message = "The file ". htmlspecialchars( basename( $_FILES['UploadFile']['name'])). " has been uploaded.";
else :
$Message = "Sorry, there was an error uploading your file.";
endif;
The actual errors:
Warning: move_uploaded_file(/var/www/html/domain.loc/internals/images/Front.jpg): Failed to open stream: Permission denied in /var/www/html/domain.loc/internals/administration/uploadsadmin.php on line 210
Warning: move_uploaded_file(): Unable to move "/tmp/php0IyD5c" to "/var/www/html/domain.loc/internals/images/test/Front.jpg" in /var/www/html/domain.loc/internals/administration/uploadsadmin.php on line 210
Line 210 with the error is the first line in the code above but I see no sign that any tmp file was ever created.
As I’ve always done, the Apache folder and file permissions are set using:
sudo chown -R $USER:www-data /var/www
sudo find /var/www -type d -exec chmod 0755 {} +
sudo find /var/www -type f -exec chmod 0644 {} +
Any ideas what’s happening?