@herminia_bruen
To enable cURL in PHP on XAMPP, you will need to follow the steps below:
- Locate the php.ini file:
- In your XAMPP installation folder, go to the php folder.
- Look for the php.ini file. This file may be located in the following directories: php/php.ini, bin/php.ini, or apache/bin/php.ini.
- Open the php.ini file in a text editor.
- Find the line that contains "extension=curl". This line may be commented out with a semicolon (;) at the beginning. Remove the semicolon to uncomment the line.
- Save the php.ini file and restart the Apache server in XAMPP.
- To verify that cURL is enabled, create a PHP file (e.g., test.php) with the following code:
1
2
3
4
5
6
7
8
|
<?php
// Check if cURL extension is enabled
if (in_array('curl', get_loaded_extensions())) {
echo "cURL is enabled";
} else {
echo "cURL is not enabled";
}
?>
|
- Place the test.php file in your XAMPP htdocs folder and access it through your web browser (e.g., http://localhost/test.php). You should see a message indicating whether cURL is enabled or not.
If you follow these steps and cURL is still not working, you may need to check if the necessary cURL library is installed on your system or enable the extension in the correct php.ini file.