有没有办法手动安装Shippo PHP文件而不使用Composer或Laravel?
我手动上传了这些文件,但是当我运行这些示例时会发现一个错误:
警告: require_once(/var/www/html/shippo/examples../../vendor/autoload.php):未能打开流:没有这样的文件或目录。
我不熟悉作曲家或拉拉维尔,也无法让作曲家工作。
发布于 2017-05-25 17:16:59
为了手动安装库,您需要确保包含到shippo-php-client/lib/Shippo.php的完整路径。所以,就像:
require('shippo-php-client/lib/Shippo.php')
但是,如果要使用此路由,则需要确保您拥有所有所需的依赖项。库当前依赖于以下PHP扩展:
这个库被设计成最容易使用Composer安装,因为它在PHP项目和框架中相当普遍。我仍然建议重新访问、设置和使用Composer来管理安装Shippo库。
发布于 2020-06-01 16:42:58
Shippo.php内部有cURL、JSON和mbstring的测试,所以不要担心它。
// Tested on PHP 5.2, 5.3
if (!function_exists('curl_init')) {
throw new Exception('Shippo needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('Shippo needs the JSON PHP extension.');
}
if (!function_exists('mb_detect_encoding')) {
throw new Exception('Shippo needs the Multibyte String PHP extension.');
}https://stackoverflow.com/questions/44160149
复制相似问题