I think 777 is an error… It is totally unsecure. You should change the owner of this folder.
For example, if your apache user is “www-apache” and its group is “www”, you have to use :
Why you have to do that :
You execute install.sh as a user (for example : “damien” of group “users”)
All files and folders created are for damien:users.
That’s wrong because apache user is probably not “damien” of group “users”.