我们最近将服务器从 PHP 5.4.15 升级到 5.5.1,并开始在日志中出现此错误
致命错误无法创建锁定文件:错误的文件描述符
我已经追踪到这一点,该代码打开了另一个小的 PHP 脚本,该脚本在后台将文件上传到 S3。
// Grab uploaded file and assign a working name
$fileTemp = $_FILES['file']['tmp_name'];
$pathToWorkingFile = tempnam($g_TmpDirectory, "TR-");
// Move the file to our working area
if (move_uploaded_file($fileTemp, $pathToWorkingFile) === false)
throw new Exception("Cannot move file to staging area.", 1011);
// Where the file will end up on S3
$s3Bucket = "test.bucket.com";
$uploadDest = "/uploads/image123.jpg";
// Create process to upload file in background
popen("/usr/local/bin/php /path/to/uploadScript.php $pathToWorkingFile $s3Bucket $uploadDest &", 'r');