我在生产服务器上安装了php 5.6和apache2。
我在生产服务器上收到了错误:Call to undefined function curl_init()
我必须为我的Project安装php-curl。我运行sudo apt-get install php5-curl
:
....
WARNING: The following packages cannot be authenticated!
php5-mysql php5-common php5-curl
....
Err http://ppa.launchpad.net/ondrej/php5/ubuntu/ trusty/main php5-mysql amd64 5.5.37+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1
403 Forbidden
Err http://ppa.launchpad.net/ondrej/php5/ubuntu/ trusty/main php5-common amd64 5.5.37+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1
403 Forbidden
Err http://ppa.launchpad.net/ondrej/php5/ubuntu/ trusty/main php5-curl amd64 5.5.37+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1
403 Forbidden
E: Failed to fetch http://ppa.launchpad.net/ondrej/php5/ubuntu/pool/main/p/php5/php5-mysql_5.5.37+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1_amd64.deb 403 Forbidden
E: Failed to fetch http://ppa.launchpad.net/ondrej/php5/ubuntu/pool/main/p/php5/php5-common_5.5.37+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1_amd64.deb 403 Forbidden
E: Failed to fetch http://ppa.launchpad.net/ondrej/php5/ubuntu/pool/main/p/php5/php5-curl_5.5.37+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1_amd64.deb 403 Forbidden
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
运行apt-get update
会显示与此ppa相同的内容:
Err http://ppa.launchpad.net trusty/main amd64 Packages
403 Forbidden
Err http://ppa.launchpad.net trusty/main i386 Packages
403 Forbidden
Err http://ppa.launchpad.net trusty/main amd64 Packages
403 Forbidden
Err http://ppa.launchpad.net trusty/main i386 Packages
403 Forbidden
安装php-curl的解决方案是什么?其中一个想法是改变ppa,但我无法为php 5.6找到另一个。
我在互联网上搜索了大约3天,发现了很多类似的问题,但我无法修复我的问题。我已经尝试了我发现的所有内容
正在运行sudo apt-get install php5.6-curl
,但我仍然在生产服务器上收到错误:Call to undefined function curl_init()
答案 0 :(得分:2)
ppa-purge ppa:ondrej/php5-5.6
删除了旧的ppa。
还为我工作sudo apt-add-repository --remove ppa:ondrej/php5-5.6