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

时间:2021-12-21 12:52:03

I have installed ubuntu Lamp stack. But the curl is not enabled, neither can I can find the extension listed in the INI file. I added manually but it didn't work either.

我已经安装了ubuntu灯栈。但是curl没有启用,我也无法找到INI文件中列出的扩展名。我手动添加的,但也不起作用。

How should I enable Curl then?

那么我该如何启用Curl呢?

8 个解决方案

#1


418  

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

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

sudo apt-get install php5-curl

After installing libcurl you should restart the web server with one of the following commands,

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

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

sudo /etc/init.d/apache2重新启动或sudo服务apache2重新启动

#2


121  

You only have to install the php5-curl library. You can do this by running

您只需安装php5-curl库。你可以通过跑步来做到这一点。

sudo apt-get install php5-curl

Click here for more information.

点击这里获取更多信息。

#3


17  

Try sudo apt-get install php-curl it worked on fresh Ubuntu 16.04 LTS, with lamp-server and php7. I tried with php7-curl - didn't work and also didn't work with php5-curl

尝试sudo apt-get安装php-curl它可以在新的Ubuntu 16.04 LTS上运行,带有lamp-server和php7。我尝试过php7-curl——既不能使用php5-curl,也不能使用php5-curl

#4


13  

For those, who is trying to install php-curl on PHP 7, will get an error. Actually if you are installing php-curl in PHP 7, the package name should be;

对于那些试图在PHP 7上安装PHP -curl的用户,将会出现错误。实际上,如果在PHP 7中安装PHP -curl,那么包名应该是;

sudo apt-get install php-curl

Not php5-curl or php7-curl, just php-curl.

不是php5-curl或php7-curl,而是php-curl。

#5


11  

First thing to do : Check for the PHP Vesion your machine is running.

首先要做的事情是:检查您的机器正在运行的PHP Vesion。

command Line :php -version

命令行:php - version

This will show something like this (in my case) :

这将显示如下内容(以我为例):

PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group

PHP 7.0.8-0ubuntu0.16.04.3 (cli) (NTS)版权(c) 1997-2016 PHP组

if : you are using PHP 5.x.x => run command : sudo apt-get install php5-curl

如果:您正在使用PHP 5.x。运行命令:sudo apt-get install php5-curl

if : PHP 7.x.x => run command (in may case) : sudo apt-get install php7.0-curl

如果:PHP 7. x。x =>运行命令(在5月份):sudo apt-get安装php7 -curl。

Enable this extention by runing :

通过运行:

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

and in the file "php.ini": search for keyword "curl" to find this line Below and change it from

在“php”文件中。ini:搜索关键字“curl”,找到下面这一行并将其从

;extension=php_curl.dll

;扩展= php_curl.dll

To:

:

extension=php_curl.dll

扩展= php_curl.dll

Next, save your file "php.ini".

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

Finally, In your command line restart your server by running : sudo service apache2 restart.

最后,在命令行中运行:sudo服务apache2重新启动。

#6


4  

Fire the below command it give list of modules

启动下面的命令,它给出模块列表

 sudo apt-cache search php5-

Then file fire below command with module name to be install

然后在命令下面文件fire,模块名称要安装

 sudo apt-get install name of the module

For reference link

链接供参考

#7


0  

Try this:

试试这个:

sudo apt-get install -y curl

#8


-1  

Try ZesleCP, it comes with all the core features of major web control panels. Add domains, sub-domains, emails everything

试试ZesleCP,它包含了主要的web控制面板的所有核心特性。添加域,子域,电子邮件一切

Its:

其:

Free Takes only 3-minutes to install

免费安装仅需3分钟

Super Light

超轻

Source: https://zeslecp.com/docs

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

Steps: Create new droplet and login into your console/PuTTY and run command

步骤:创建新的droplet并登录到控制台/PuTTY并运行命令

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

All DONE.

全部完成。

#1


418  

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

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

sudo apt-get install php5-curl

After installing libcurl you should restart the web server with one of the following commands,

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

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

sudo /etc/init.d/apache2重新启动或sudo服务apache2重新启动

#2


121  

You only have to install the php5-curl library. You can do this by running

您只需安装php5-curl库。你可以通过跑步来做到这一点。

sudo apt-get install php5-curl

Click here for more information.

点击这里获取更多信息。

#3


17  

Try sudo apt-get install php-curl it worked on fresh Ubuntu 16.04 LTS, with lamp-server and php7. I tried with php7-curl - didn't work and also didn't work with php5-curl

尝试sudo apt-get安装php-curl它可以在新的Ubuntu 16.04 LTS上运行,带有lamp-server和php7。我尝试过php7-curl——既不能使用php5-curl,也不能使用php5-curl

#4


13  

For those, who is trying to install php-curl on PHP 7, will get an error. Actually if you are installing php-curl in PHP 7, the package name should be;

对于那些试图在PHP 7上安装PHP -curl的用户,将会出现错误。实际上,如果在PHP 7中安装PHP -curl,那么包名应该是;

sudo apt-get install php-curl

Not php5-curl or php7-curl, just php-curl.

不是php5-curl或php7-curl,而是php-curl。

#5


11  

First thing to do : Check for the PHP Vesion your machine is running.

首先要做的事情是:检查您的机器正在运行的PHP Vesion。

command Line :php -version

命令行:php - version

This will show something like this (in my case) :

这将显示如下内容(以我为例):

PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group

PHP 7.0.8-0ubuntu0.16.04.3 (cli) (NTS)版权(c) 1997-2016 PHP组

if : you are using PHP 5.x.x => run command : sudo apt-get install php5-curl

如果:您正在使用PHP 5.x。运行命令:sudo apt-get install php5-curl

if : PHP 7.x.x => run command (in may case) : sudo apt-get install php7.0-curl

如果:PHP 7. x。x =>运行命令(在5月份):sudo apt-get安装php7 -curl。

Enable this extention by runing :

通过运行:

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

and in the file "php.ini": search for keyword "curl" to find this line Below and change it from

在“php”文件中。ini:搜索关键字“curl”,找到下面这一行并将其从

;extension=php_curl.dll

;扩展= php_curl.dll

To:

:

extension=php_curl.dll

扩展= php_curl.dll

Next, save your file "php.ini".

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

Finally, In your command line restart your server by running : sudo service apache2 restart.

最后,在命令行中运行:sudo服务apache2重新启动。

#6


4  

Fire the below command it give list of modules

启动下面的命令,它给出模块列表

 sudo apt-cache search php5-

Then file fire below command with module name to be install

然后在命令下面文件fire,模块名称要安装

 sudo apt-get install name of the module

For reference link

链接供参考

#7


0  

Try this:

试试这个:

sudo apt-get install -y curl

#8


-1  

Try ZesleCP, it comes with all the core features of major web control panels. Add domains, sub-domains, emails everything

试试ZesleCP,它包含了主要的web控制面板的所有核心特性。添加域,子域,电子邮件一切

Its:

其:

Free Takes only 3-minutes to install

免费安装仅需3分钟

Super Light

超轻

Source: https://zeslecp.com/docs

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

Steps: Create new droplet and login into your console/PuTTY and run command

步骤:创建新的droplet并登录到控制台/PuTTY并运行命令

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

All DONE.

全部完成。