PHP cURL not loading correctly in Apache on Windows - php

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 ?

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

cURL and Windows have never been a happy couple, you'll need an extension for this, go to
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
and download the cURL version that corresponds to your PHP version under "Fixed curl extensions" then replace the php_curl.dll in ext folder.
Hope it helps

Related

PHP mbstring doesn't work, but I set everything

I set in the php.ini file the mbstring, php_mbstring.dll is on its place, but php can't load the mudule. I tried everything, what I found on stackoverflow, or anywhere else, but nothing.
-php directory is located in C:\php
-php_mbstring.dll is located in C:\php\ext\php_mbstring.dll
-;extension_dir = "ext" row is outcommented, but I tried remove the semicolon, and set it to "C:\php\ext", also tried it with / signs
-extension=mbstring row has no semicolon before tried to name it to php_mbstring.dll, tried to give the whole path (C:\php\ext\php_mbstring.dll), tried it with outcommented extension_dir = "ext", tried it all the possible ways, with \ sign and / sign, but always the same failure...
-another device of mine (notebook) runs the mbstring, I copied the dll file from it, tried with that all the possibilities above, tried to download another dll file, also tortured through the ways above, but nothing. The dll file is on its place, the path is authentical, it's enabled in the php.ini, but it doesn't work...
Warning: PHP Startup: Unable to load dynamic library 'mbstring'
(tried: C:\php\ext\mbstring (A megadott modul nem található.),
C:\php\ext\php_mbstring.dll (A megadott modul nem található.)) in
Unknown on line 0
Using Atom editor and Atom live server, it outputs the following:
Listening on http://localhost:8000 Document root is
C:\Users\ferenczi\Desktop\Saját cuccok\html
programozás\Projectek\Hander at line 0, file Unknown[Mon May 17
05:40:46 2021] PHP Warning: PHP Startup: Unable to load dynamic
library 'mbstring' (tried: C:\php\ext\mbstring (A megadott modul nem
talC!lhatC3.), C:\php\ext\php_mbstring.dll (A megadott modul nem
talC!lhatC3.)) [Mon May 17 05:40:56 2021] PHP 7.4.12 Development
Server (http://localhost:8000) started
Everything else working perfect. PHP working, SQL queries working, mysql extension working.
The right way is to install php-mbstring package and let it enable the mbstring extension automatically:
sudo apt-get install php-mbstring
if you want to enable or diable, please go with the below command
sudo phpdismod mbstring # disable mbstring extension
sudo phpenmod mbstring # enable mbstring extension
Try this!

php_sqlsrv_71_nts.dll not loading. Configuring ms sql server in php 7.1.0

I am trying to configure ms sql server database plugin in php 7.1.0 wamp server. I have downloaded windows 10 pr0 ms sql server php plugins from microsodt web site and placed in C:\wamp\bin\php\php7.1.22\ext . and modified the php_ini file with these extensions name and enabled odbc driver also .. Still i am getiing this issue,
> [20-Dec-2018 07:10:25 UTC] PHP Warning: PHP Startup: Unable to load
> dynamic library
> 'c:/wamp/bin/php/php7.1.22/ext/php_pdo_sqlsrv_71_nts.dll' - The
> specified module could not be found. in Unknown on line 0
> [20-Dec-2018 07:10:25 UTC] PHP Warning: PHP Startup: Unable to load
> dynamic library 'c:/wamp/bin/php/php7.1.22/ext/php_sqlsrv_71_nts.dll'
> - The specified module could not be found. in Unknown on line 0 [20-Dec-2018 07:10:26 UTC] PHP Warning: PHP Startup: Unable to load
> dynamic library
> 'c:/wamp/bin/php/php7.1.22/ext/php_pdo_sqlsrv_71_nts.dll' - The
> specified module could not be found. in Unknown on line 0
> [20-Dec-2018 07:10:26 UTC] PHP Warning: PHP Startup: Unable to load
> dynamic library 'c:/wamp/bin/php/php7.1.22/ext/php_sqlsrv_71_nts.dll'
> - The specified module could not be found. in Unknown on line 0
extension=php_bz2.dll
extension=php_curl.dll
extension=php_com_dotnet.dll
;extension=php_enchant.dll
extension=php_fileinfo.dll
;extension=php_ftp.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_odbc.dll
extension=php_pdo_sqlsrv_71_ts.dll
extension=php_pdo_sqlsrv_71_nts.dll
extension=php_sqlsrv_71_ts.dll
extension=php_sqlsrv_71_nts.dll
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_phpdbg_webhelper.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
extension=php_soap.dll
extension=php_sockets.dll

CentOS x86 but PHP looking for mysql in /lib64/

It's straight, I don't know why PHP keep looking for mysql.so in /lib64 because my VPS is running CentOS 6.8 x86.
I have double check and don't see any reference to to /lib64 at all
php.ini: extension_dir = "./"
my.ini: extension=/usr/lib/php/modules/php_mysql.so
Here is httpd error log, any suggestion ?
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - /usr/lib64/php/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

xhprof on WampServer 2.2

I am trying to get XHProf working on my WampServer.
I have downloaded the dll from: http://dev.freshsite.pl/php-extensions/xhprof/file/details/xhprof-0103-for-php-53-vc9.html and renamed to xhprof.dll in C:\wamp\bin\php\php5.3.9\ext (Which is the dir listed for extensions in phpinfo())
Php.ini path from phpinfo():
C:\wamp\bin\apache\Apache2.2.21\bin\php.ini
Extensions listed in that file:
extension=php_curl.dll
extension=xhprof.dll
;extension=php_dba.dll
extension=php_mbstring.dll
;extension=php_exif.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_ming.dll
;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_oci8_11g.dll
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.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_phar.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
But when I restart WampServer and the services associated with it, no XHProf information appears in phpinfo()
I am looking for a way to fix this, or a further way to investigate why this extension isnt loading
Thanks
You are using WampServer 64-bit, but the xhprof.dll is made for the 32-bit architecture and isn't compatible. Ony my own Windows 7 machine I got this error in the apache_error.log:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.8/ext/php_xhprof.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
<br />
<b>Warning</b>: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.8/ext/php_xhprof.dll' - %1 is not a valid Win32 application.
in <b>Unknown</b> on line <b>0</b><br />
It doesn't seem that there is a 64-bit version at this time, so you are limited to options of what you can do. The first choice is to use the 32-bit version of WampServer (on a development machine I can't see too many drawbacks with this). The second is to sweet-talk the makers at fresh-site to compile/support 64-bit. Good luck!
Thanks Leonard Challis. I had a similar error for a few hours. I needed to use php_ibm_db2.dll. After adding it to the extension folder and the php.ini file. I started getting the error message.
Unable to load dynamic library 'c:/wamp/bin/php/php5.3.13/ext/php_ibm_db2.dll' - %1 is not a valid Win32 application.
Some solutions I came across advise to put it in the system32 folder. That did not help. I went to several forums and blogs. All advises failed. Until I saw you recommendation. So simple, can't figure out why I did not think of that. Although the error message is a bit vague.
BTW, for those who are working with a PHP to DB2 environment the dll files may be obtained here: http://sourceforge.net/projects/db2mc/files/.
Ensure that you also install Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) - vcredist_x86.exe.
http://www.microsoft.com/en-us/download/details.aspx?id=8328
I hope this helps anyone that may have a similar problem in the future. Thanks to everyone who contributed to this forum. It was a great help.

Windows + PHP 5.3.6 - Undefined function, mysql_connect?

We have a brand new webserver upon which we installed Apache, then PHP, pointing it to Apache's conf dir, and installing all of the optional pieces. I'm now trying to get MySQL to connect, and it refuses. My PHP.ini lists the module as uncommented, and it is in the directory my extension dir is set to, but I just keep getting:
Fatal error: Call to undefined function mysql_connect() in C:\apache\htdocs\index.php on line 8
I installed:
PHP: VC9 x86 Thread Safe (2011-Mar-22 13:27:32)
Apache: Apache 2.2
MySQL: Windows (x86, 64-bit), MSI Installer
Windows: Windows 7
I've added PHP to my PATH var, and have phpinfo() outputting, but I'm not sure what to look for. All of the docs I've read seem to indicate that in PHP 5.3.x+ MySQL / MySQLi support should be enabled by default.
phpinfo's mysqlnd info:
mysqlnd
mysqlnd enabled
Version mysqlnd 5.0.8-dev - 20102224 - $Revision: 308673 $
Compression supported
SSL supported
Command buffer size 4096
Read buffer size 32768
Read timeout 31536000
Collecting statistics Yes
Collecting memory statistics No
Tracing n/a
phpinfo's configure command info:
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--disable-isapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet" "--with-mcrypt=static"
phpinfo's loaded config file info:
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\Program Files (x86)\PHP\php.ini
Inside of that, towards the bottom:
[dba]
;dba.default_handler=
; Local Variables:
; tab-width: 4
; End:
[PHP_BZ2]
extension=php_bz2.dll
[PHP_CURL]
extension=php_curl.dll
[PHP_FILEINFO]
extension=php_fileinfo.dll
[PHP_GD2]
extension=php_gd2.dll
[PHP_GETTEXT]
extension=php_gettext.dll
[PHP_GMP]
extension=php_gmp.dll
[PHP_IMAP]
extension=php_imap.dll
[PHP_INTL]
extension=php_intl.dll
[PHP_LDAP]
extension=php_ldap.dll
[PHP_MBSTRING]
extension=php_mbstring.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
[PHP_OPENSSL]
extension=php_openssl.dll
[PHP_PDO_MYSQL]
extension=php_pdo_mysql.dll
[PHP_PDO_ODBC]
extension=php_pdo_odbc.dll
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
[PHP_PGSQL]
extension=php_pgsql.dll
[PHP_SOAP]
extension=php_soap.dll
[PHP_SOCKETS]
extension=php_sockets.dll
[PHP_SQLITE]
extension=php_sqlite.dll
[PHP_SQLITE3]
extension=php_sqlite3.dll
[PHP_TIDY]
extension=php_tidy.dll
[PHP_XMLRPC]
extension=php_xmlrpc.dll
[PHP_EXIF]
extension=php_exif.dll
EDIT: So I played around with my .ini a bit, deleting it, putting junk in it, and phpinfo() kept the same info. So I actually looked hard, and I have my .ini set upload_max_filesize to 200M, but phpinfo says 2M. What gives? It's the exact file that phpinfo is trying to tell me is the .ini.
It turns out there was a parse error in the config file due to the paren in Program Files (x86) not being enclosed with quotes. Great call by Charles to suggest starting PHP from the command line!
Most common mistake (particularly on Windows) is to forget setting up the path of "extension_dir" in the php.ini file. PHP by default assumes C:\php\ext, whereas many prefer to unzip PHP to C:\Program Files\PHP.

Categories