April 19, 2009 by Ivan Kristianto
[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:
1. Create a file in your web server (in Ubuntu it would be in /var/www folder), name it info.php
2. Open that file and type this command:
<?php phpinfo(); ?>
3. Save that file
4. Open your favorite browser and open that file (ex: http://localhost/info.php)
5. Now you will see the Information about your PHP installation
6. 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:
1. Open your terminal and type this command:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
2. After it finish open php.ini file (mine is at /etc/php5/apache2/php.ini ) and add this command: extension=curl.so
3. Save the file and restart apache with this command:
4. Check the PHP information page again, you will find PHP-CURL installed
5. That’s it
Most hosting providers todays already have Curl installed on their server. Just in case you confuse which hosting provider are good to host your websites and have no downtime since i use it, you can try to look at Hawkhost. Thanks.