Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php.ini - setting upload_tmp_dir

I have a page which allows users to upload photos - fairly standard php I think.

This works on the live server I've been using to date but I've recently set up php on my Mac and now the uploads have stopped working.

I'm guessing this is because the the upload_tmp_dir is not set properly in the php.ini file.

Does anyone know what I need to do?

EDIT:

Here's the error message that's output...

Warning: imagejpeg(): Unable to open 'upload/thumbs/AL.jpg' for writing: Permission denied in /Users/tom/Sites/tombrennand/add.php on line 128 Warning: imagejpeg(): Unable to open 'upload/images/AL.jpg' for writing: Permission denied in /Users/me/Sites/mysite/add.php on line 135 Notice: Undefined variable: con in /Users/me/Sites/mysite/add.php on line 172 Warning: mysql_close() expects parameter 1 to be resource, null given in /Users/me/Sites/mysite/add.php on line 172

So from that I think I need to set permissions on that folder. Any ideas?

like image 407
Tom Avatar asked Sep 06 '25 03:09

Tom


1 Answers

Change the

upload_tmp_dir = /tmp/whatever

entry in your php.ini file. Ensure that this location is writable by the appropriate user/group.

like image 62
Ryan Avatar answered Sep 07 '25 17:09

Ryan