Autodesk Forge :: localhost:3000 上的错误 404
Autodesk Forge :: Error 404 on localhost:3000
我正在尝试制作本教程(从这里 Forge : View your models)(php),但我得到了带有 HTTP 错误 404 的空白页面,知道吗?
调试器中没有任何内容,其他任何地方都没有...
调用此 uri http://localhost:3000/api/forge/oss/buckets 时出现此错误
( ! ) Notice: Undefined index: id in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\server\oss.php on line 54
Call Stack
# Time Memory Function Location
1 0.8060 405488 {main}( ) ...\index.php:0
2 0.8591 519816 Klein\Klein->dispatch( ) ...\index.php:50
3 0.8661 552248 Klein\Klein->handleRouteCallback( ) ...\Klein.php:572
4 0.8661 552248 call_user_func:{D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php:859} ( ) ...\Klein.php:859
5 0.8661 552248 {closure:D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\index.php:27-30}( ) ...\Klein.php:859
6 0.8661 552288 Autodesk\ForgeServices\DataManagement->getBucketsAndObjects( ) ...\index.php:29
( ! ) Fatal error: Uncaught InvalidArgumentException: Missing the required parameter $bucket_key when calling getObjects in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php on line 925
( ! ) Klein\Exceptions\UnhandledException: Missing the required parameter $bucket_key when calling getObjects in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php on line 925
Call Stack
# Time Memory Function Location
1 0.8060 405488 {main}( ) ...\index.php:0
2 0.8591 519816 Klein\Klein->dispatch( ) ...\index.php:50
3 0.8751 667432 Klein\Klein->error( ) ...\Klein.php:629
在尝试 localhost:3000/www/index.html 调试后,我在 oss.php 文件的第 65 行得到了这个 Notice: Only variables should be passed by reference
。我还注意到令牌和旧桶已加载
正如 Samuel 在评论中指出的那样,存储桶密钥未提供给后端处理程序,因此出现错误。
但实际上前端不处理 empty/incorrect 存储桶密钥输入,因此在后端调用了错误...如果您可以实现自己的(检查输入的存储桶密钥是否有效)像 here 来捕获空输入 ...
我不确定这是否是一个解决方案,让我们试试:
当转到 localhost/www/ 它显示页面但不加载任何内容,在 oss.php 的第 65 行我已经用这些替换了该行:
$cbkeyParts = explode('-', $cbkey);
$cbtext = ForgeConfig::$prepend_bucketkey && strpos($cbkey, strtolower(ForgeConfig::getForgeID())) === 0 ? end($cbkeyParts) : $cbkey;
end(explode('-', $cbkey));
出错,应删除 explode 函数并用变量替换。
现在简单地使用 localhost:3000 而不是添加 /www/index.html,看起来 .htaccess 重写规则在带有 VS 代码的 php 服务器上不起作用,所以我尝试了 apache,但仍然无法正常工作。
我正在尝试制作本教程(从这里 Forge : View your models)(php),但我得到了带有 HTTP 错误 404 的空白页面,知道吗? 调试器中没有任何内容,其他任何地方都没有... 调用此 uri http://localhost:3000/api/forge/oss/buckets 时出现此错误
( ! ) Notice: Undefined index: id in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\server\oss.php on line 54
Call Stack
# Time Memory Function Location
1 0.8060 405488 {main}( ) ...\index.php:0
2 0.8591 519816 Klein\Klein->dispatch( ) ...\index.php:50
3 0.8661 552248 Klein\Klein->handleRouteCallback( ) ...\Klein.php:572
4 0.8661 552248 call_user_func:{D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php:859} ( ) ...\Klein.php:859
5 0.8661 552248 {closure:D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\index.php:27-30}( ) ...\Klein.php:859
6 0.8661 552288 Autodesk\ForgeServices\DataManagement->getBucketsAndObjects( ) ...\index.php:29
( ! ) Fatal error: Uncaught InvalidArgumentException: Missing the required parameter $bucket_key when calling getObjects in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php on line 925
( ! ) Klein\Exceptions\UnhandledException: Missing the required parameter $bucket_key when calling getObjects in D:\ArMediaCG\www\...\AutoCad API Extention\apps\Forge\first_tutorial\vendor\klein\klein\src\Klein\Klein.php on line 925
Call Stack
# Time Memory Function Location
1 0.8060 405488 {main}( ) ...\index.php:0
2 0.8591 519816 Klein\Klein->dispatch( ) ...\index.php:50
3 0.8751 667432 Klein\Klein->error( ) ...\Klein.php:629
在尝试 localhost:3000/www/index.html 调试后,我在 oss.php 文件的第 65 行得到了这个 Notice: Only variables should be passed by reference
。我还注意到令牌和旧桶已加载
正如 Samuel 在评论中指出的那样,存储桶密钥未提供给后端处理程序,因此出现错误。
但实际上前端不处理 empty/incorrect 存储桶密钥输入,因此在后端调用了错误...如果您可以实现自己的(检查输入的存储桶密钥是否有效)像 here 来捕获空输入 ...
我不确定这是否是一个解决方案,让我们试试: 当转到 localhost/www/ 它显示页面但不加载任何内容,在 oss.php 的第 65 行我已经用这些替换了该行:
$cbkeyParts = explode('-', $cbkey);
$cbtext = ForgeConfig::$prepend_bucketkey && strpos($cbkey, strtolower(ForgeConfig::getForgeID())) === 0 ? end($cbkeyParts) : $cbkey;
end(explode('-', $cbkey));
出错,应删除 explode 函数并用变量替换。
现在简单地使用 localhost:3000 而不是添加 /www/index.html,看起来 .htaccess 重写规则在带有 VS 代码的 php 服务器上不起作用,所以我尝试了 apache,但仍然无法正常工作。