0

WIN 10 Microsoft PC (not linux). I've installed PHP V 7.1.9.

Right now, i'm trying to install Curl. However I'm getting odd issues,

phpinfo :-

1) Curl is reporting an AUTHOR of Sterling Hughes, however no modules are active / found for curl.

So i'm guessing it knows the author - php knows curl is available ?

2) the file path for the Configuration File (php.ini) shows the path C:\WINDOWS, however Ive checked there & there is NO php.ini file located.

I have checked for hidden files too...

Ive got PHP installed in 2-3 other directories (i guess in one of the PATH directories, so thats why php is loading.)

QUERIES:

3) is there a php code to diagnose the true / correct pathname of where the php.ini is loaded from ? So i can edit it & uncomment the line about installing the curl dll file.

(I have those lines uncommented in the php.ini files I could find).

4) Is there a way in a php script to "load" up Curl if its not in the php.ini file ?

(ive downloaded CURL in a ZIP file & extracted the files).

all the examples so far refer to php.ini, but no examples of PHP code to activate / load up Curl from within a php script itself without being installed via the php.ini file.

G Stewpot
  • 97
  • 1
  • 2
  • 10
  • FURTHER: Fatal error: Uncaught Error: Call to undefined function curl_init() in ..... -rechecked phpinfo & the extensions directory is c:\php\ext - Ive checked that and there IS a php_curl.dll file in that directory. Off to bed, but will recheck tomorrow. – G Stewpot Sep 17 '17 at 13:40

1 Answers1

0
  1. Retrieve PHP.ini path: You can try with PHP functions. php_info() or php_ini_loaded_file()

    http://php.net/manual/en/function.phpinfo.php

    http://php.net/manual/en/function.php-ini-loaded-file.php

  2. Way to load up CURL dynamically ?

    You can't. There was a function to achieve it but had been removed. http://php.net/dl

To install Curl, follow the instruction below

http://php.net/manual/en/curl.installation.php

Similar question(Very helpful):

PHP and CURL under Windows 7 64 bits and Apache

jesuisgenial
  • 685
  • 1
  • 5
  • 15