vigour wrote: I am pretty sure I don't have the right permission to do it.
Why only "pretty sure?" You should know without a doubt if that's the case because PHP will generate an error message accordingly. Do you have display_errors set to On and error_reporting set to E_ALL?
vigour wrote:How do I give my php script permission to create a file?
The user account that PHP is being executed under must have at least write permissions on the directory where the file is being created.
As far as how to do that on a Mac, I would probably just open Terminal (it's under Utilities) and use chmod.