okay Mr. Craig, I found the solution by tests and I am still wondering if this is the correct way to solve it. Please reply me to let general know about it. @digitalstartup
My Solution:
Step 0. (Optional)
Change back the owner of /var/www/html to the www-data
sudo chown -R www-data:www-data /var/www/html
This Step 0 is optional because I can’t make Step 1 successfully when the owner of /var/www/html is user “magento2” which is not superuser.
Step 1.
Run command
sudo chmod -R 775 /var/www/html
as the “superuser” from within any directory first, -R
is missing at the below link, I think it’s quite important in this case:
The documents’ name turn Green if they changed into 775!
Step 2.
Final Step, do remember to change the owner of /var/www/html back to “magento2” by command
sudo chown magento2:www-data /var/www/html
Notice (magento2 = username of Magento databases’ owner which I chose at the beginning we set up our Magento), it equals to character of user “magento” in Ubuntu Server at How to install Magento 2.4.5-p1 and build a web server (updated)
Result:
We did it!