Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP cURL not loading correctly in Apache on Windows

Tags:

php

curl

apache

I have recently set up apache+php+mysql from scratch and everything seems to be working fine except the cURL , imap and interbase extensions of PHP

The ext directory has all the necessary dlls including php_curl.dll and the other mentioned extensions however , in the error log , the following is coming

PHP Warning:  PHP Startup: Unable to load dynamic library 'B:/XServ/host/php/ext\\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'B:/XServ/host/php/ext\\php_intl.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'B:/XServ/host/php/ext\\php_interbase.dll' - The specified module could not be found.\r\n in Unknown on line 0
[Tue Jul 12 19:16:07.025738 2016] [mpm_winnt:notice] [pid 2100:tid 344] AH00354: Child: Starting 64 worker threads.

As you may have noticed , there are two trailing backslashes instead of a forward slash.

Also , here is a snippet of my php.ini

extension_dir = "B:/XServ/host/php/ext"

extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
;extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

All other extensions work fine.

I am on Windows 8.1 , Apache 2.4.23 , PHP 7.0.8

Any solution for this ?

like image 791
Aaditya Chakravarty Avatar asked Jul 12 '16 14:07

Aaditya Chakravarty


1 Answers

You may want to test PHP first.

Have you tried to run php -v on the console? It will return you the exact error why it can't load the specified modules even if the extension_dir has the correct path.

ALSO

libCurl needs the file libssh2.dll. So, to resolve it try the following:

Copy the libssh2.dll file from your PHP Directory to the BIN dir of Apache (same location as httpd.exe)

or

In your httpd.conf file, add this `LoadFile B:/XServ/host/php/libssh2.dll

like image 66
SiNONiMiTY Avatar answered Nov 03 '22 03:11

SiNONiMiTY