【发布时间】:2020-01-30 19:06:01
【问题描述】:
我正在尝试使用 http_build_str() 和 http_build_url() 函数。我已经安装并启用了 pecl_http,但我仍然收到此错误:
Call to undefined function http_build_str()
我已经上下验证了扩展程序已安装并启用。如果他们的权限设置错误,我也已经遇到过那种警告消息,所以我也可以排除这种情况。
然后我遇到了 extension_loaded() 和 get_extension_funcs()。他们的结果有点令人困惑:
print_r(extension_loaded('http')); // true
print_rt(get_extension_funcs('http')); // []
进行完整性检查后,我针对我知道有效的不同扩展运行了这些函数,并且确实在函数数组中得到了一些结果。如您所见,“http_build_str”和“http_build_url”并不是我所期望的get_extension_funcs() 输出的一部分。有人可以帮忙吗?
如果重要的话,我会在 Docker 容器中进行设置,我认为其配置的相关部分如下:
RUN apt-get update && apt-get install --no-install-recommends -y \
git-core \
build-essential \
openssl \
libssl-dev \
libcurl4-openssl-dev
RUN docker-php-ext-install pdo_mysql mbstring exif zip pcntl ftp
RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN docker-php-ext-install gd
RUN pecl install propro raphf \
&& docker-php-ext-enable propro raphf \
&& rm -rf /tmp/pear
RUN pecl install pecl_http xdebug \
&& docker-php-ext-enable http xdebug \
&& rm -rf /tmp/pear
【问题讨论】:
标签: php http module php-extension pecl