Bluetooth app with XAMPP permission problem in Mac OS 11
The way to setup this depends on how exactly you're running PHP. It can be run in various ways such as for example inside httpd in an Apache module, as a CGI executable or through a process manager such as FPM.
The important thing here is that you must give the Bluetooth privileges to the process or parent of the process (or grandparent, etc.) that is actually running your PHP code.
For example that could be your php-fpm daemon in a FPM setup.