Php 在opencart扩展安装程序中安装插件时出现错误

Php 在opencart扩展安装程序中安装插件时出现错误,php,ftp,opencart,Php,Ftp,Opencart,在extension installer中安装rest API时,收到的警告为enable FTP。在使用必要信息启用FTP后,收到的警告为 SyntaxError:Unexpected token < in JSON at position 0 Ok <b>Warning</>:ftp_chdir();Failed to change directory. in <b>/var/www/html/admin/controller/ext

在extension installer中安装rest API时,收到的警告为enable FTP。在使用必要信息启用FTP后,收到的警告为

SyntaxError:Unexpected token < in JSON at position 0    
Ok    
<b>Warning</>:ftp_chdir();Failed to change directory. in <b>/var/www/html/admin/controller/extension/installer.php</b> on line<b>298</b>{"error":"Could not set root directory as"}
我已将FTP根目录添加为public_html/并已将opencart上载文件夹转移到/var/www/html。
FTP根目录不正确吗?

如果根文件夹被称为html,为什么要将其设置为public\u html

FTP根目录显示在远程站点中:当您使用Filezilla中的FTP详细信息登录时,例如:


因此,在您的情况下,它可能是/html/,请注意,您应该添加尾随斜杠/

太好了,如果您的FTP帐户转到您网站的根目录,那么yes/将起作用。安装插件后,无法使用API。获取错误,因为找不到请求的URL/API/rest在此服务器上找不到。url“domain/api/rest/cart”有什么问题?您是否启用了SEO url并将.htaccess.txt重命名为.htaccess?是的,完成了。我已经重写了htaccess文件中的规则。然后它就可以正常工作了。