basic environment
Ubuntu 16.04.1
apache 2.4
php 7.1.7
the root directory of the php file is a directory under a windows machine mounted through samba
//192.168.44.1/dev/144 on /home/wwwroot type cifs (rw,nosuid,nodev,noexec,relatime,vers=default,cache=none,domain=,uid=0,forceuid,gid=0,forcegid,addr=192.168.44.1,file_mode=0777,dir_mode=0777,nounix,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)
The directory itself is accessible. Have all rw permissions, but not x permissions
part of the error report.
84: if(file_exists($targetPath))return true;
85: if (!$tran) return rename($fromPath, $targetPath);
[2018-03-26 09:44:45] local.ERROR: ErrorException: rename(/tmp/php2aXCEp,/home/wwwroot/cm/public_static/upload/user/1b/11384324d7be4098700a14ecfb418a.png): Operation not permitted in /home/wwwroot/cm/app/Helpers/FileReceiver.php:85
http://php.net/manual/en/func.
according to the documentation, rename to unsupported file systems after version 4.3.3 "may" generate a warning.
but now the situation is that this function directly throws an error, but the file is copied successfully.
there are also several guys in the same situation at the bottom of this official document [that is, they are all trampled at the bottom. " Adding @ and re-file_exists can basically solve the problem, but how did this happen?