What folder permission should I use for Unity to access with UnityWebRequest?

I have a PHP script on my server and I need to access it from Unity using UnityWebRequest. How should I set the read/write permissions on this folder?

I would prefer not to set it to public. But after I set the permission only to root, now Unity gets a HTTP error.

It’s not a Unity question. UnityWebRequest do not require any unusual permissions to operate. If your php script is working in with regular browser or any common www api testing suite, it should also work fine with UnityWebRequest. Refer to your web server man pages to configure public folders permissions.

There’s no way to do it that it’s not accessible from a web browser but it is accessible from Unity?

Not really.

In your script you could require certain information sent from your build to the web server which wouldn’t be obvious to anyone who just opens the page in their browser. But someone determined will eventually be able to find it by sifting through your build or using wireshark.