• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

Having trouble uploading file from PHP - think it is a tmp directory permission thing

I know nothing about linux but am in the process of trying to move a site from a shared hosting situation to a dedicated one.  Whereas my script to upload files worked on my old server, it is no longer working.  I am 99% sure that I have a permission issue on the temp directory.  At first I was useing the defualt temp directory for the server (I was not setting the upload_tmp_dir explicitily in php.ini).  However, when that didn't work, I thought maybe I should set it, so I set it to "./tmp/"  Where is that file located so that I can check permissions?

Thansk!
Courtney
0
consultgal
Asked:
consultgal
  • 3
  • 2
1 Solution
 
m1tk4Commented:
./tmp/ is located in tmp subdirectory of a directory where your php script is. "./" in unix is "current directory"
0
 
consultgalAuthor Commented:
Will linux create the directory if it doesn't exist?

Or do I need to create it manually?

Thanks!
Courtney
0
 
m1tk4Commented:
>> Will linux create the directory if it doesn't exist?

No.

>> Or do I need to create it manually?

Yes, and it should be writeable by the user your Apache runs as, typically "nobody" or "apache" - check your Apache config for User parameter.
0
 
consultgalAuthor Commented:
Thanks for your help!  Have I mentioned I'm a newbie?  I'm going to try and steal one final answer: which file would the user parameter be located in?

Thanks!

Courtney
0
 
m1tk4Commented:
Depending on your distribution,

/etc/httpd/conf/httpd.conf
/usr/local/apache/conf/httpd.conf

etc. Try

locate httpd.conf

0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now