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.
Related
I am a very junior dev working in a small software company.
Since I started 5 daysago I have database connection problems. Everything started from the setting up of my new working environment.
I have now a PC working on windows 10 and I had to install Apache 2.4 and php7 'manually', without using Wampp, Ampp etc. I did it, many times, comparing each line of my configuration and framework lines to those of my colleagues but I am still not able log in my users, to dysplay use the database, etc. In the browser (any) the error message is "Cannot connect to database".
My company uses Mysql workbench (my boss does not like it) and SQLyog (prefered to manage the databases). So I tried to solve the problem installinf phpMyAdmin. I cheked any parameter, the php.ini is good, every file is well located.
When I try to reach index/php/phpmyadmin (we use our own mvc framework) I geta message error sayong thar msqli extension is missing, with this link : http://localhost/phpmyadmin/doc/html/faq.html#faqmysql. Please note that I have this in my php.ini :
;extension=php_bz2.dll
;extension=php_curl.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_mysql.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
and there is no error in extension_dir = ******/****/
Can you help me please?
Cordially
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
I'm running Apache 2.4.7 with PHP 5.5.9 on Windows 8. I installed PHPUnit and this warning image "warning" started to pop up.
Yes I enabled extension loading in php.ini as well as "extension_dir" to correct folder and there is file named "php_pdo_oci.dll" in that folder.
I tried to use different apache and php releases, but it didn't help.
Any suggestions how to fix this?
The ..._oci.dll is part of the Oracle C Interface. Unless you need to use Oracle, I suggest you go to the relevant line inside the php.ini file and uncomment the loading of this extension. However, if you need to use this extension, you’ll need to install the free Oracle Client libraries and add them to the path.
Oracle has a page where you can download the libraries needed for your setup work as expected and you can see here:
Oracle Instant Client Downloads
Note: After you choose your operational system (Windows as in your answer) in download section you will see the installation guide in foot notes of the next page. For others OSs this process will work the same way.
I currently have PHP version 7.1.9 and encountered this problem and resolved the issue. Just ensure these lines in your php.ini file are uncommented like so:
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_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
Please restart your server application (IIS, Apache e.t.c.) after any changes to your php.ini file.
Please add below line in php.ini file
extension=pdo.so
extension=php_pdo.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
and restart apache server and check.
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.
I'm trying to get a PHP script to run every 30 minutes on my server (Win XP SP3, xampp 1.7.3).
To do so I'm running the following script (update.cmd) using the MS task scheduler
SET PATH="C:\xampp\PHP"
start php.exe \htdocs\update_dashboard.php
I am using the oci8 php extension on my webserver, but when I run that script it gives me errors that php.exe can't find the necessary dll for the oci8 extension. I get the following errors:
This application has failed to start because OCI.dll was not found. Re-installing the application may fix this problem.
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_oci8.dll' - The specified module count not be found.
I know that the file is there and I don't get those errors when the php is run through apache, am I running the wrong copy of php.exe? Any ideas why not? Does my PATH have to be set differently? My Windows PATH includes:
C:\instantclient_11_2;C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\Program Files\ActiveState Komodo Edit 5\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Altiris\Software Virtualization Agent\
Thanks for your help.
I found this problem when I switch from php 5.3 non thread safe to php 5.3 thread safe on windows 7, and I ticked install everything
I fixed the issue by commenting out extension=php_oci8.dll, extension=php_oci8_11g.dll, extension=php_pdo_oci.dll in the php.ini
I also had issues with the sybase extension wanting a libcs.dll, which I solved by removing "extension=php_sybase_ct.dll"
eg
; at bottom of php.ini -->>
[PHP_BZ2]
extension=php_bz2.dll
[PHP_CURL]
extension=php_curl.dll
[PHP_ENCHANT]
extension=php_enchant.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_OCI8]
;extension=php_oci8.dll
;[PHP_OCI8_11G]
;extension=php_oci8_11g.dll
[PHP_OPENSSL]
extension=php_openssl.dll
[PHP_PDO_MYSQL]
extension=php_pdo_mysql.dll
;[PHP_PDO_OCI]
;extension=php_pdo_oci.dll
[PHP_PDO_ODBC]
extension=php_pdo_odbc.dll
[PHP_PDO_PGSQL]
extension=php_pdo_pgsql.dll
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
[PHP_PGSQL]
extension=php_pgsql.dll
[PHP_SHMOP]
extension=php_shmop.dll
[PHP_SNMP]
extension=php_snmp.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_SYBASE_CT]
;extension=php_sybase_ct.dll
[PHP_TIDY]
extension=php_tidy.dll
[PHP_XMLRPC]
extension=php_xmlrpc.dll
[PHP_XSL]
extension=php_xsl.dll
[PHP_EXIF]
extension=php_exif.dll
Guessing if you need sybase and oracle database connections the standard clients install oci.dll and libcs.dll in the appropriate places, for everyone else who doesn't need to use these dbs just disable the php extensions, and it should run fine :)
Ant
I've solved the problem in a way by changing the script. It's now:
C:\xampp\PHP\php.exe -f C:\xampp\htdocs\php_scripts\utils\update_dashboard.php
Thanks for the help.
Check the php.ini file that php is using by running a phpinfo() from the command line, and look to see what extensions are enabled in that file. It's quite commopn for php to be set to use a different php.ini file when running from the command line; and xampp certainly uses a different php.ini file by default. You can also tell it what php.ini file to use with the -c switch
I ran the php -m command. Turned out that my system's OCI.dll went either corrupt or missing. I recovered it by running sfc /scannow in the run box, rebooted, system reinstalled it, and it was up and running with my extensions now all working.
Am I correct that both C:\instantclient_11_2 and C:\oracle\ora92\bin contain a OCI.DLL? Because of the order of the path you might load the wrong dll. When I read Which OCI8 DLL to use in PHP 5.3 you need a different line in the php.ini depending on the version of the oracle client. I currently have no access to a pc with oracle, so I cannot verify this.