0

I am having an issue uploading files using PHP. Based on my research the user of the apache service needs to have permissions to the folder that files need to be uploaded to. I have done that as shown below

drwxrwxrwx 2 admin www-data 4096 Jun 13 01:59 temp

However when I try to upload the file the process times out and what is left in the directory is this

-rw------- 1 www-data www-data 79 Jun 13 01:54 POST0yS17Q the POST0yS17Q is just an encrypted file id.

Can anyone help as to why the files are not uploading? Please note the same code works on a Windows server fine. So I have doubts that the code itself is an issue.

Kern Elliott
  • 1,659
  • 5
  • 41
  • 65
  • Does your PHP code check for upload errors? `$_FILES['upfile']['error']` – RiggsFolly Jun 14 '20 at 11:49
  • There is too much potential reasons without a minimum code sample. Please provide something – yergo Jun 14 '20 at 11:53
  • Not sure what else to provide as the code works on other servers. The website works fine also the only issue is the file upload and I am unable to find any errors in the error log to provide either. – Kern Elliott Jun 14 '20 at 12:03
  • Does the uploaded file end up in the `upload_tmp_dir` folder? – Pieterjan Jun 28 '20 at 12:01
  • Another possibility is that the filesize exceeds the configured limit. I found a list that may help troubleshooting the issue: https://stackoverflow.com/questions/12531408/setting-php-tmp-dir-php-upload-not-working – Pieterjan Jun 28 '20 at 12:07

1 Answers1

0

Set file_uploads = On in your php.ini file

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Pieterjan
  • 2,738
  • 4
  • 28
  • 55