I have Apache 2.4.12 and php 5.6.9 on my Windows 8 computer and I'm trying to enable the curl extension for php however, I haven't had much success. After searching the internet for this issue it appears that other's have had the same trouble. Here are the suggestions I've found:
;extension=php_curl.dll
in php.ini ;extension_dir = "ext"
in php.ini I've tried every single suggestion with no success except the third item in the list because it doesn't have a .dll file for curl with php 5.6, in fact the highest version avaible is one for php 5.4. There has to be way to enable this extension without having to downgrade my php version to 5.4 and using a .dll file from that website. I've tried searching the internet for a .dll file like the one on the linked website for php 5.6 opposed to a version of php that's outdated but I've had no luck in finding one so I'd like help with this issue.
How can I enable curl for php 5.6 on my Windows 8 machine?
Locate your php folder and follow these instructions:
Move to Windows\\system32 folder:
libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll
Move to Apache24\\bin folder
libssh2.dll
Uncomment extension=php_curl.dll
Note: Don't overwrite when prompted.
I give you an example of a set up that just worked perfectly for me :
C:\\php
, php.ini-development
, uncommenting 2 lines :
extension=php_curl.dll
extension_dir = "ext"
php.ini
. I just tested it via the CLI (windows CMD here) on a PHP a file (ie C:\\php\\php myFile.php
) and cURL worked.
If you have Apache installed and prefer to test it in a browser, you obviously have to adapt this installation with your own files structure and to do not forget to restart Apache.
Running apache service with a specific user other than local system solved the problem for me. You can test this easily by stopping the apache service and running manually <apache dir>\\bin\\httpd.exe
.
I fixed this problem by adding C:\\php
and C:\\php\\ext
to PATH
system variables.
You'll see the Path
variable in the System Variables box in the bottom. Append your PHP path to that variable. Now the system will be able to load the extensions.
In addition to uncommenting the line
;extension_dir = "ext"
Try also setting it to the absolute path of the PHP installation's ext folder and then restarting apache.
eg:
extension_dir = "C:\PHP 5.6.19\ext"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.