Some system files aren't available for just anyone (or any program) to change or delete. This is for your own good. For such cases you need to act as the root user, or superuser. Usually this means typing "sudo" before the command and it will ask you for a password. This will allow you to do something as the superuser.
sudo nano php.ini
The above code will open the nano editor and allow you to edit and save. Substitute nano with the command to open the editor of your choice. (I don't even know if nano is on a mac by default)