1

PHP Version 7.2.1 Apache Version: Apache/2.4.29 (Win64) OpenSSL/1.0.2n PHP/7.2.1 OS: Windows Server 2012 R2

I enabled cURL in my php.ini file. When I try to load modules in console: php -m I got: Client console

There we can see that cURL is loaded and it is working when I use php [script path] command

But cURL is not loaded on my Apache Server

i have info.php page which contains:

<?php 
if(in_array  ('curl', get_loaded_extensions())) {
    echo "CURL is available on your web server\n";
}
else{
    echo "CURL is not available on your web server\n";
}

print_r(get_loaded_extensions());
phpinfo(); 
?>

Which tell if cURL is in loaded extensions, write them down, and show classic php info details.

This is output: info.php

There is no cURL in loaded extension. But if you check php.ini file it is C:/PHP/php.ini <- one i changed (removed ";" to enable extension.)

And when I try to run cURL commands from server I get:

Fatal error: Uncaught Error: Call to undefined function curl_multi_init() in C:\web\databaseservers\generate-db-server-stats2.php:27 Stack trace: #0 {main} thrown in C:\web\databaseservers\generate-db-server-stats2.php on line 27

(This script works locally.)

Where can be problem?

Edit1: Adding snippet from my php.ini enter image description here

There you can see that file i am editing is correct one (Path above) And that curl is enabled as extension (PHP7.2 and above doesn't require prepone "php_" and postpone ".dll")

EDIT2: Fixed : for PHP7 ... I added php dir path in system enviroment varible, deleted libeay32.dll and ssleay32.dll from apache/bin, keep these dll in php directory and its work. – Wasim A. Mar 17 at 19:10 Linked topic helped

Martin Tomko
  • 155
  • 1
  • 1
  • 13
  • 1
    Possible duplicate of [Call to undefined function curl\_init().?](https://stackoverflow.com/questions/6382539/call-to-undefined-function-curl-init) Please have a look at answer for windows. – BenRoob Aug 08 '18 at 07:45
  • My extension is enabled (I added screen to prove) and it works locally just not on a server. Apache is somehow blocking it ? – Martin Tomko Aug 08 '18 at 08:01
  • Did you install curl on your server? – NoobTW Aug 08 '18 at 08:21
  • Not sure how you mean that. I enabled it in my php settings. Locally it works so its installed on my machine. My Apache server is loading php's config file "php.ini" which has curl enabled. So i guess it should work. Or is there more steps i am required to do on apache server? in "httpd.conf" there is no curl enable option – Martin Tomko Aug 08 '18 at 08:25
  • Fixed, Thank you BenRoob – Martin Tomko Aug 08 '18 at 08:49
  • Hooow? :O @MartinTomko – Tudvari Jan 18 '22 at 13:38

0 Answers0