gpt4 book ai didi

PHP 错误文件描述符错误

转载 作者:行者123 更新时间:2023-12-05 08:44:02 25 4
gpt4 key购买 nike

我们最近将服务器从 PHP 5.4.15 升级到 5.5.1,并开始在日志中收到此错误

Fatal Error Unable to create lock file: Bad file descriptor

我已经追踪到这段代码打开了另一个小的 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');

最佳答案

原来这个错误是由于我们在PHP升级过程中配置了OPcache导致的。当我通过从 php.ini 中删除此设置来禁用命令行操作时,一切正常。

opcache.enable_cli=1

关于PHP 错误文件描述符错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17933882/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com