gpt4 book ai didi

PHP - 复制导致 HTTP 错误 500

转载 作者:太空宇宙 更新时间:2023-11-03 17:19:03 25 4
gpt4 key购买 nike

PHP 执行导致 HTTP 错误 500。我在 driver_license.exe 上有 chmod -R 777。

enter image description here

<?php
$agent= $_GET['agentid'];
$userid = $_GET['userid'];

$file = "/home/www/file/driver_license.exe";
$path = "/home/www/file/";
"
$newfile ="driver_license_userid_1.exe";

$file_to_save = $path . $newfile;
if (!copy($file, $file_to_save)) {
echo "FAILED";
}
else {
echo "<a href=https://download.example.com/{$newfile}>DOWNLOAD & INSTALL</a>";
}

最佳答案

1.你有多余的"$path = "/home/www/file/"; 之后.删除它。

2.你忘记在href周围加上引号.添加那个

所以代码需要:-

<?php
$agent= $_GET['agentid'];
$userid = $_GET['userid'];

$file = "/home/www/file/driver_license.exe";
$path = "/home/www/file/";
//" need to remove or comment
$newfile ="driver_license_userid_1.exe";

$file_to_save = $path . $newfile;
if (!copy($file, $file_to_save)) {
echo "FAILED";
}
else {
echo "<a href='https://download.example.com/{$newfile}'>DOWNLOAD & INSTALL</a>"; // ' added around href
}

重要说明:- 文件夹需要获得访问权限(为 077 文件夹授予 home,www and file 权限)

关于PHP - 复制导致 HTTP 错误 500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48145866/

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