如何在Lando上安装pecl_http(HttpRequest)?

时间:2019-05-03 15:01:11

标签: php docker pecl lando

我正在研究一个PHP项目,并且有一个使用HttpRequest类的第三方API包装器(因此它需要安装PECL_HTTP PHP库)。我将Lando(v3.0.0-rc.12)与基本LAMP reciepe一起用于本地开发:

recipe: lamp
config:
  webroot: .
  php: '5.6'

通过这种设置,当我尝试像这样的类Fatal error: Class 'HttpRequest' not found时,我得到了$request = new HttpRequest( $url );

基于讨论hereherethere,我尝试通过在我的lando.yml文件中添加以下配置来在Lando上安装PECL_HTTP:

services:
  appserver:
    build_as_root:
     - apt-get update -y
     - apt-get install -y curl libcurl3 libcurl4-gnutls-dev libmagic-dev
     - pecl install -f pecl_http-1.7.6
     - docker-php-ext-enable pecl_http

这无济于事,并且HttpRequest仍然不可用,而lando start在安装软件包时显示此错误消息:

 Starting projectname_appserver_1 ... done
 Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
 Ign http://deb.debian.org jessie InRelease
 Get:2 http://deb.debian.org jessie-updates InRelease [7340 B]
 Get:3 http://deb.debian.org jessie Release.gpg [2420 B]
 Get:4 http://deb.debian.org jessie Release [148 kB]
 Get:5 http://security.debian.org jessie/updates/main amd64 Packages [831 kB]
 Get:6 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
 Fetched 10.1 MB in 10s (980 kB/s)
 W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease  Unable to find expected entry 'main/binary-amd64/Packages' in  Release file (Wrong sources.list entry or malformed file)
 E: Some index files failed to download. They have been ignored, or old ones used instead.

我的想法已经用完了。我在做什么错了?

0 个答案:

没有答案