PHP CURL Enable Linux
If anyone else stumbles onto this page from google like I did:
use putty (putty.exe) to sign into your server and install curl using this command :
sudo apt-get install php5-curl
Make sure curl is enabled in the php.ini file. For me it's in /etc/php5/apache2/php.ini,
if you can't find it, this line might be in /etc/php5/conf.d/curl.ini. Make sure the line :
extension=curl.so
is not commented out
then restart apache, so type this into putty:
sudo /etc/init.d/apache2 restart
Info for install from https://askubuntu.com/questions/9293/how-do-i-install-curl-in-php5, to check if it works this stack overflow might help you: Detect if cURL works?
How to install php-curl in Ubuntu 16.04
In Ubuntu 16.04 default PHP version is 7.0, if you want to use different version then you need to install PHP package according to PHP version:
- PHP 7.4:
sudo apt-get install php7.4-curl
- PHP 7.3:
sudo apt-get install php7.3-curl
- PHP 7.2:
sudo apt-get install php7.2-curl
- PHP 7.1:
sudo apt-get install php7.1-curl
- PHP 7.0:
sudo apt-get install php7.0-curl
- PHP 5.6:
sudo apt-get install php5.6-curl
- PHP 5.5:
sudo apt-get install php5.5-curl
How do I install the ext-curl extension with PHP 7?
Well I was able to install it by :
sudo apt-get install php-curl
on my system. This will install a dependency package, which depends on the default php version.
After that restart apache
sudo service apache2 restart
How can I enable cURL for an installed Ubuntu LAMP stack?
From Install Curl Extension for PHP in Ubuntu:
sudo apt-get install php5-curl
After installing libcurl, you should restart the web server with one of the following commands,
sudo /etc/init.d/apache2 restart
or
sudo service apache2 restart
Related Topics
How to Remove the Bom from a Utf-8 File
Generating a Sha-256 Hash from the Linux Command Line
Best Way to Find Os Name and Version in Unix/Linux Platform
Linux Bash Script to Extract Ip Address
Sort Not Sorting as Expected (Space and Locale)
How to Recall the Argument of the Previous Bash Command
Getting Pids from Ps -Ef |Grep Keyword
Linux: Find All Symlinks of a Given 'Original' File? (Reverse 'Readlink')
Splitting a File in Linux Based on Content
Linux Terminal Input: Reading User Input from Terminal Truncating Lines at 4095 Character Limit
Linux Command: How to 'Find' Only Text Files
How to Compile/Install Node.Js(Could Not Configure a Cxx Compiler!) (Ubuntu)
What Is Global _Start in Assembly Language
How to Tell in Linux Which Process Sent My Process a Signal
Problem with Bash Output Redirection