[HowTo] Install Curl in PHP5 and Apache
This time i want to share with you how to install Curl in PHP5 in Linux Environtment (I’m using Ubuntu 8.10) and using apache web server, but if you have any question to install php-curl in other environment, feel free to contact me of leave any comment, i will glad to help you.
Okay, now let’s start with check if php-curl is already installed in your server or not.
To check it please follow this step:
- Create a file in your web server (in Ubuntu it would be in /var/www folder), name it info.php
- Open that file and type this command:
<?php phpinfo(); ?>
- Save that file
- Open your favorite browser and open that file (ex: http://localhost/info.php)
- Now you will see the Information about your PHP installation
- Search for Curl, and if you cannot find it, it mean your php doesn’t have curl installed.
To install php-curl please follow this steps:
- Open your terminal and type this command:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
- After it finish open php.ini file (mine is at /etc/php5/apache2/php.ini ) and add this command: extension=curl.so
- Save the file and restart apache with this command:
- Check the PHP information page again, you will find PHP-CURL installed
- That’s it
Most hosting providers today already have Curl installed on their server.