MacOS – Bluetooth app with XAMPP permission problem in Mac OS 11

bluetoothmacosPHPprivacyterminal

I using a web GUI for controlling some Bluetooth devices. I use PHP shell_exec command to run our created Bluetooth terminal app. My fiction was work until Mac OS 11.

My customers upgrade Mac OS 10.15 to Mac OS 11. Apple added Bluetooth in Security Privacy settings.

I tried our terminal app, it is running. But it wanted to add Terminal app Bluetooth in Security Privacy settings

I tried add httpd in Bluetooth in Security Privacy settings. But it does not work

Best Answer

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.