If you are having problems like file writing or opening with PHP in mac then you should consider changing the permissions on the folders.
All Permissions (Read, Write, Execute)
Considering you want to give all the permissions to everyone, you can use this
sudo chmod -R u+rwX,g+rwX,o+rwX /path/to/your/folder
The -R flag applies the change to all folders and files recursively.
Using the rwX symbolic mode will add read and write (rw) permissions for the user (u), group (g), and other users (o), and optionally permit execution (X) of files if they are already executable for somebody or if they are a directory.
This is equivalent to the 777 mode, except with a smarter executable bit.
You are going to need superuser permissions to execute this command so to run this command as root we are prefixing it with sudo or you might get any 'permission denied' errors when running it.
file folder Mac OS permissions