atilkan www-data:www-data can be broken into two parts
User www-data and group www-data
so the command changes the owner and group of the files to www-data, recursively.
Your webserver needs access to your files in order to display them to the web and will use a limited user (possibility www-data). If your permissions don't let that limited user access or write to the file, it becomes a "not writable" directory.
While the above command will fix it, it's not ideal since now www-data is the owner of all the files - even ones it doesn't need write access to. Generally, the least access the better when it comes to publically accessible files.
Ideally, having all files owned by you and accessible to the web software user (eg www-data) with certain directories group writable (eg flarum/assets) is the best way to go.
To have the owner be you and group be the webserver group, you can do this (if your username is atilkan)
sudo chown atilkan:www-data -R /var/www/yourwebdirectory
After that accessed flarum, and he asked to fix some problems. Enable php-gd (fixed) and set permissions to 0755 on some folders. (storage, assets, extensions)
Well I run chmod 0775 , chmod -R 0775, sudo chmod 0775 and still giving the problem.
Which I should of thought of here. Permissions of 775 means owner and group can write and access directory, but everyone (global) is access but read only. Unless the OP changed the group to the webserver user, it wouldn't give permission
Since 777 (everybody can write and access) worked, this is likely the issue.
luceos For production environments (on shared servers) 0777 is like an open invitation to get hacked.
Not just hacked, but open to all sorts of issues. Any user anywhere on the server can delete, modify, create files in those directories. To be clear, it is the last 7 of 777 that is the risk - since it defines the global access.
To test the security of your server for what just anyone could delete or modify, create a new user (eg using adduser), switch to that user and run
find / -writable | less
If it finds files outside of its home directory, those are files that you could accidentally destroy through a mishaped remove command 😉