【发布时间】:2013-07-29 20:47:03
【问题描述】:
我们最近将服务器从 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');
【问题讨论】:
-
我们不知道你的代码的其余部分是什么样的......那个 sn-p 似乎没什么用......
-
我希望至少
$SOME $ARGUMENTS得到escapeshellarg()的治疗。 -
可能是文件系统损坏,测试和修复取决于您的操作系统。 fsck 是在 linux 上启动或在 windows 上扫描/检查磁盘的地方
-
跳出来的一件事是您尝试从您在后台中运行的进程中读取?
-
@JaredD 我鼓励您在“答案”框中发布您的解决方案。