Double-check that you have write permissions on the "/artist/" directory. If Apache is running this script (or another server), then you will have to give it write permissions by:
1 - giving apache ownership
chown apache /path/to/artist
2 - granting group write access (775) and assigning it to the apache group
chgrp apache /path/to/artist
chmod 775 /path/to/artist
3 - or by giving global write access (777)
chmod 777 /path/to/artist