Linux php curl install

How to install php-curl on Ubuntu 20.04 (Focal Fossa)?

In this article we are going to learn the commands and steps to install php-curl package on Ubuntu 20.04 (Focal Fossa).

Quick installation of php-curl Architecture: all Version: 2:7.4+75:

Step 2: Install: php-curl Architecture: all Version: 2:7.4+75

Ater updaing the OS run following command to install the packae:

sudo apt-get install php-curl Architecture: all Version: 2:7.4+75

How to install php-curl Architecture: all Version: 2:7.4+75 on Ubuntu 20.04 LTS?

First of all update your system with the command:

Above command will download the package lists for Ubuntu 20.04 LTS on your system. This will update the list of newest versions of packages and its dependencies on your system.

After downloading the latest package list with the help of above you can run the installation process.

If php-curl Architecture: all Version: 2:7.4+75 is not installed on your compter then the command ‘dpkg -L php-curl Architecture: all Version: 2:7.4+75’ will give followin error.

deepak@deepak-VirtualBox:~$ dpkg -L php-curl [1mdpkg-query:[0m package 'php-curl' is not installed Use dpkg --contents (= dpkg-deb --contents) to list archive files contents. deepak@deepak-VirtualBox:~$

Installing php-curl Architecture: all Version: 2:7.4+75:

After system update use the following command to install php-curl Architecture: all Version: 2:7.4+75:

sudo apt-get install php-curl Architecture: all Version: 2:7.4+75

Above command will confirm before installing the package on your Ubuntu 20.04 LTS Operating System. If you are not already logged in as su, installer will ask you the root password. After completion of the installation you can use the package on your system.

How to uninstall/remove php-curl Architecture: all Version: 2:7.4+75 from Ubuntu 20.04 LTS?

Now we will see the commands for uninstalling the php-curl Architecture: all Version: 2:7.4+75 from Ubuntu 20.04 LTS. For uninstalling this package you can easily use the apt command and remove the package from Linux Operating System.

To remove the php-curl Architecture: all Version: 2:7.4+75 following command is used:

sudo apt-get remove php-curl Architecture: all Version: 2:7.4+75

Following command is used to remove the php-curl Architecture: all Version: 2:7.4+75 package along with its dependencies:

sudo apt-get remove --auto-remove php-curl Architecture: all Version: 2:7.4+75

This will remove php-curl Architecture: all Version: 2:7.4+75 and all its dependent packages which is no longer needed in the system.

Completely removing php-curl Architecture: all Version: 2:7.4+75 with all configuration files:

Following command should be used with care as it deletes all the configuration files and data:

sudo apt-get purge php-curl Architecture: all Version: 2:7.4+75

or you can use following command also:

sudo apt-get purge --auto-remove php-curl Architecture: all Version: 2:7.4+75

Above command will remove all the configuration files and data associated with php-curl Architecture: all Version: 2:7.4+75 package. You can can’t recover the delete data, so, use this command with care.

Читайте также:  Браузер chromium gost linux

Copyright © DevManuals.net 2016

Источник

Linux php curl install

Для использования cURL необходимо собрать PHP с опцией —with-curl[=DIR], где DIR — имя каталога, содержащего подкаталоги lib и include . Каталог include должен содержать подкаталог curl с файлами easy.h и curl.h . В каталоге lib должен быть файл libcurl.a .

Замечание: Замечание для пользователей Win32
Для работы с этим модулем в Windows файлы libeay32.dll и ssleay32.dll , либо, начиная с OpenSSL 1.1, libcrypto-*.dll и libssl-*.dll , должны существовать в системной переменной окружения PATH . Также libssh2.dll должен присутствовать в вашей переменной окружения PATH . Вам не требуется файл libcurl.dll с сайта cURL.

User Contributed Notes 21 notes

I already had Apache and PHP5 setup, but simply adding php5-curl and curl did *not* work. I also had to get libcurl3 and libcurl3-dev. The full command:

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

You’ll know if it works because phpinfo() will get a new section with Curl info.

Upgrading to php 5.6.9 on Windows 7 x64 curl no longer is recognised. No errors on server start package just not available and didn’t show in phpinfo.php. deplister.exe was ok
I fixed coping the following list files from php folder (in my case D:\xampp\php)
libeay32.dll
libssh2.dll
ssleay32.dll
to c:\xampp\apache\bin (or your apache\bin path), restart apache and works fine, apache’s libraries were outdated

Beginning with version 1.1.0 OpenSSL did change their libary names!
libeay32.dll is now libcrypto-*.dll (e.g. libcrypto-1_1-x64.dll for OpenSSL 1.1.x on 64bit windows)
ssleay32.dll is now libssl-*.dll (e.g. libssl-1_1-x64.dll for OpenSSL 1.1.x on 64bit windows)

You may be confused, as I was, by the instructions for installing cURL in php. The instruction «To use PHP’s cURL support you must also compile PHP —with-curl[=DIR]. » was murky to me, since I didn’t compile php when I installed it. I just copied all of the necessary files to the correct folders as described very clearly in the php manual.

I am using Windows XP and Apache with php 5.1.6. In this situation, and it may apply to php versions of 5.0 and later, all one needs to do is remove the «;» from the front of the directive extension=php_curl.dll. You should also check to make certain that libeay32.dll and ssleay32.dll are in your php directory with the other dll’s. This directory should already be in you path, so the instruction to put them in you path is not critical.

You can then run phpinfo() and you should see a heading for curl in the listing.

Succinctly, my installation of cURL consisted of removing the semi-colon in front of the ;extension=php_curl.dll line in php.ini, saving php.ini and restarting Apache. You may wish to try this if you are using php 5.0 and later and are having difficulty understanding the instructions on the cURL installation page at php.net

You dont need to copy files to use PHP CURL with Apache 2.4 — use the LoadFile directive in your apache config file instead:
LoadFile «C:/php7/libssh2.dll»
(that was all it took for me to get it work)

Читайте также:  Zabbix загрузка cpu linux

If you’re dense like I am, spare yourself the trouble on an Ubuntu system (probably Debian too) and.

$ sudo apt-get install php5-curl

Then feel dumb, but not as dumb as me.

If you are running on Windows with a Wampserver or alike preconfigured PHP, if you did everything that was advised (path is correct, dlls are in the System32 or the Wow64 folder, php_curl extension uncommented in the php.ini, rebooted your machine and restarted your services), and you still receive messages saying that curl is not installed :
— maybe you are running a command line script (and not a curl instruction within a web application). If yes, remember that there are 2 distinct php.ini configuration files : one for the php-cli commands (run php at command line) and one for the php instructions (run from a page in your www folder).
Wampserver’s menuitem «php.ini» only opens the webserver’s php.ini, not the php-cli one.
So it will be great to check your php-cli’s php.ini configuration file ! (you’ll find it in the php.exe’s installation folder)
You need to uncomment the extension php_curl in this php.ini file for the command lines to work with curl.
Also uncomment the php_openssl extention by the way (often used with curl).
I hope this fixed issue will help someone else 🙂

It is not necessary to always (re)compile PHP. For me it was sufficient to install php5-curl and restart Apache:

$ sudo apt-get install php5-curl
$ sudo /etc/init.d/apache2 restart

Источник

How To Install php-curl on Ubuntu 22.04

In this tutorial we learn how to install php-curl on Ubuntu 22.04.

What is php-curl

This package provides a CURL module for PHP.

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

This package is a dependency package, which depends on Debian’s default PHP version (currently 8.1).

There are three ways to install php-curl on Ubuntu 22.04. We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.

Install php-curl Using apt-get

Update apt database with apt-get using the following command.

After updating apt database, We can install php-curl using apt-get by running the following command:

sudo apt-get -y install php-curl 

Install php-curl Using apt

Update apt database with apt using the following command.

After updating apt database, We can install php-curl using apt by running the following command:

sudo apt -y install php-curl 

Install php-curl Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

After updating apt database, We can install php-curl using aptitude by running the following command:

sudo aptitude -y install php-curl 

How To Uninstall php-curl on Ubuntu 22.04

To uninstall only the php-curl package we can use the following command:

sudo apt-get remove php-curl 

Uninstall php-curl And Its Dependencies

To uninstall php-curl and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove php-curl 

Remove php-curl Configurations and Data

To remove php-curl configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge php-curl 

Remove php-curl configuration, data, and all of its dependencies

We can use the following command to remove php-curl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge php-curl 

References

Summary

In this tutorial we learn how to install php-curl package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.

Читайте также:  Alt linux статика ip address

Источник

How to Install PHP Curl Extension in Ubuntu?

In this tutorial, we will go over the demonstration of how to install php curl extension in ubuntu. This post will give you a simple example of ubuntu php install curl extension. I’m going to show you about install php curl extension ubuntu 20.04. you will learn install php curl extension ubuntu.

We can install php curl extension using php-curl library. i will give you following list of commands to install php curl extension in ubuntu 22.10, ubuntu 22.04, ubuntu 21.10, ubuntu 21.04, ubuntu 20.04, ubuntu 18.04 and ubuntu 16.04 server.

You need to run both command one by one:

sudo apt-get install php-curl

Solution for PHP 8.2

You need to run both command one by one:

sudo apt-get install php8.2-curl

Solution for PHP 8.1

You need to run both command one by one:

sudo apt-get install php8.1-curl

Solution for PHP 8.0

You need to run both command one by one:

sudo apt-get install php8.0-curl

Solution for PHP 7.4

You need to run both command one by one:

sudo apt-get install php7.4-curl

Solution for PHP 7.3

You need to run both command one by one:

sudo apt-get install php7.3-curl

Solution for PHP 7.2

You need to run both command one by one:

sudo apt-get install php7.2-curl

Hardik Savani

I’m a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.

We are Recommending you

  • How to Find php.ini File in Ubuntu?
  • How to Check Current PHP Version in Ubuntu?
  • How to Check Apache Access & Error Log Files in Ubuntu Server?
  • How to Whitelist/Allow IP Address in Apache Ubuntu?
  • How to Restrict/Block IP Address in Apache Ubuntu?
  • How to Install Apache PHP MySQL and Phpmyadmin on Ubuntu?
  • How to Install MySQL in Ubuntu Server?
  • How to Upgrade PHP Version from 7.4 to 8 in Ubuntu?
  • How to Install Yarn npm in Ubuntu?
  • How to Upgrade PHP Version from 7.2 to 7.3 in Ubuntu?
  • How to Enable Apache mod_rewrite Module in Ubuntu?
  • How to create quick apache virtual host in Ubuntu?
  • How to Install Sublime Text Editor in Ubuntu?

Источник

Оцените статью
Adblock
detector