File upload returning "Missing to Temporary Folder"

Asked

Viewed 90 times

1

I have my site hosted on Godaddy and on this site I have a part for uploads, this worked well until days ago, now started returning the error 6 - Missing a Temporary Folder for any file I try to upload, I tried several ways to resolve by changing php.ini and still nothing.

In my PHP file if I use the command file_exists(sys_get_temp_dir()); returns me true, so the folder is there.

If I use the command is_writable(sys_get_temp_dir()); return me false, maybe there is the problem, but the folder /tmp from my server (which is the one that is configured, the default) is with the permission drwxrwxrwt..

If anyone can help me in this problem, since I followed several tutorials and nothing of the solution.

  • What appears when you spin it: $ ls -l /tmp

  • Give me a list of files and folders, as it is enough I will update my question with the data that appear there.

  • Friend I think you put a bar at the end of the command I mentioned, and it returned the list of what is inside the folder /tmp. The command $ ls -l /tmp it was to return something more or even so: lrwxrwxrwx@ 1 root admin 11 Nov 18 23:55 /tmp -> private/tmp

  • If the folder permissions are not lrwxrwxrwx the problem should be just that, if it is already so then check in your php.ini if it really is using the directory /tmp.

  • @Kayobruno with the command you told me it shows what’s inside the folder, if I give one ls -l / it returns me the data from that /tmp folder and the return is drwxrwxrwt. 14 root root 4096 Mar 12 02:23 tmp

  • Opa @Gabrielqueirozschicora see if this helps you https://stackoverflow.com/questions/29343809/php-is-writable-function-always-returns-false-fora-writable-directory

  • @When I executed the cameo sudo chcon -R -t httpd_sys_rw_content_t /tmp gave me several warnings talking chcon: can't apply partial context to unlabeled file ‘NOME_DO_ARQUIVO’ where NOME_DO_ARQUIVO is the name of the intended folder files /tmp and finally the message chcon: failed to change context of ‘/tmp’ to ‘system_u:object_r:httpd_sys_rw_content_t:s0’: Read-only file system.

  • I had seen several people talking to give one chmod 777 /tmp and I would, but you mistake me for being a Read-only file system, then I saw people talking to do mount e remount (I don’t know these linux commands well) but also me error that can not run remount in this folder.

  • In the second reply of the link you sent me, it says to use sestatus to see the status of Selinux (I also don’t know what it’s for) but it is as disabled, this should be enabled?

Show 4 more comments

1 answer

2


Well, the problem has been solved and it is more strange than I imagined, I will leave the answer here to serve of help in case someone has the same problem.

It was necessary to execute the command chmod 777 /tmp, but this command could not be executed since it gave error that the folder was read-only (Ready-Only file system). To solve this it was necessary to mount and remount but also could not because I did not let me remount the folder /tmp

For another reason I needed to restart the server and magically the server let me change the permissions to 777 (from drwxrwxrwt. for drwxrwxrwx.). With that problem solved.

I thank everyone who tried to help.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.