我尝试了与在 Ubuntu 14.04 上相同的操作:
apt-get install -y libpcre3-dev
apt-get install -y libcurl4-gnutls-dev
printf "\n" | pecl install pecl_http-3.1.0
# did not install raphf and propro because they come with pecl_http
echo "extension=http.so" > /etc/php/7.0/mods-available/http.ini
ln -s /etc/php/7.0/mods-available/http.ini /etc/php/7.0/cli/conf.d/20-http.ini
ln -s /etc/php/7.0/mods-available/http.ini /etc/php/7.0/fpm/conf.d/20-http.ini
chmod 644 /etc/php/7.0/mods-available/http.ini
echo "extension=raphf.so" > /etc/php/7.0/mods-available/raphf.ini
ln -s /etc/php/7.0/mods-available/raphf.ini /etc/php/7.0/cli/conf.d/20-raphf.ini
ln -s /etc/php/7.0/mods-available/raphf.ini /etc/php/7.0/fpm/conf.d/20-raphf.ini
chmod 644 /etc/php/7.0/mods-available/raphf.ini
echo "extension=propro.so" > /etc/php/7.0/mods-available/propro.ini
ln -s /etc/php/7.0/mods-available/propro.ini /etc/php/7.0/cli/conf.d/20-propro.ini
ln -s /etc/php/7.0/mods-available/propro.ini /etc/php/7.0/fpm/conf.d/20-propro.ini
chmod 644 /etc/php/7.0/mods-available/propro.ini
我收到错误:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/http.so' - /usr/lib/php/20151012/http.so: cannot open shared object file: No such file or directory in Unknown on line 0
我尝试寻找在 Ubuntu 16.04 上安装 http_chunked_decode 的较新解决方案,但没有成功。
谢谢你的帮助
更新 1: 还必须安装:
apt-get install -y libcurl4-openssl-dev
现在我不再收到此错误,但函数 http_chunked_decode 仍然不起作用
答案1
尝试apt-get install php-pecl-http php-pecl-http-dev