如何启用curl,安装Ubuntu LAMP堆栈?

我已经安装了Ubuntu的灯pipe栈。 但curl没有启用,我也不能find在INI文件中列出的扩展名。 我手动添加,但它也没有工作。

那么我应该如何启用Curl?

http://buzznol.blogspot.com/2008/12/install-curl-extension-for-php-in.html

sudo apt-get install php5-curl 

安装libcurl之后,您应该使用以下命令之一重新启动Web服务器,

sudo /etc/init.d/apache2 restartsudo service apache2 restart

你只需要安装php5-curl库。 你可以通过运行来做到这一点

 sudo apt-get install php5-curl 

点击这里获取更多信息。

试试sudo apt-get install php-curl它在新鲜的Ubuntu 16.04 LTS上工作,使用lamp-server和php7。 我尝试使用php7-curl – 没有工作,也没有与php5-curl

对于那些试图在PHP 7上安装php-curl的人,将会出错。 其实如果你在PHP 7中安装php-curl,包名应该是;

 sudo apt-get install php-curl 

不是php5-curl或者php7-curl ,只是php-curl

首先要做的是检查你的机器运行的PHP Vesion。

命令行: php -version

这将显示像这样(在我的情况):

PHP 7.0.8-0ubuntu0.16.04.3(cli)(NTS)版权所有(c)1997-2016 PHP集团

如果:你正在使用PHP 5.xx =>运行命令: sudo apt-get install php5-curl

如果:PHP 7.xx =>运行命令(在这种情况下): sudo apt-get install php7.0-curl

通过运行来启用此扩展:

 sudo gedit /etc/php/7.0/cli/php.ini 

并在文件“php.ini”中:search关键字“curl”,find这一行下面并从中更改

;延长= php_curl.dll

至:

延长= php_curl.dll

接下来,保存你的文件“php.ini”。

最后,在你的命令行中通过运行sudo service apache2 restart重启你的服务器。

发出下面的命令,给出模块列表

  sudo apt-cache search php5- 

然后用模块名称命令下面的命令进行安装

  sudo apt-get install name of the module 

供参考链接

尝试这个:

 sudo apt-get install -y curl 

尝试使用ZesleCP,它具有主要网页控制面板的所有核心function。 添加域名,子域名,发送电子邮件

它的:

免费仅需3分钟即可安装

超级光

来源: https : //zeslecp.com/docs

步骤:创build新的液滴并login到控制台/ PuTTY并运行命令

 cd /home && curl -o latest -L http://zeslecp.com/release/latest && sh latest 

全做完了。