How to enable cURL in PHP / XAMPP
To enable cURL in PHP / XAMPP, follow these steps:
- Open the XAMPP control panel.
- Click the "Config" button next to the Apache service.
- In the Apache (httpd.conf) configuration file that opens, search for the following line:
- Remove the # character from the beginning of the line to uncomment it. The line should now look like this:
- Save the httpd.conf file and close it.
- In the XAMPP control panel, click the "Restart" button next to the Apache service to restart the Apache server.
- Open the PHP (php.ini) configuration file. On Windows, this file is typically located at C:\xampp\php\php.ini.
- Search for the following line in the file:
- Remove the ; character from the beginning of the line to uncomment it. The line should now look like this:
- Save the php.ini file and close it.
- In the XAMPP control panel, click the "Stop" button next to the Apache service, and then click the "Start" button to restart the Apache server.
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule rewrite_module modules/mod_rewrite.so
Watch a video course
Learn object oriented PHP
;extension=curl
extension=curl
cURL should now be enabled in your PHP installation. To test it, create a PHP file with the following code:
<?php
if (function_exists('curl_version')) {
echo 'cURL is installed and enabled';
} else {
echo 'cURL is not installed or enabled';
}
Save the file and load it in your web browser. If cURL is enabled, the message "cURL is installed and enabled" should be displayed.