Page 1 of 2

php_mysqli extension unable to load

Posted: Mon Jun 04, 2007 6:43 pm
by bluepsykoe
Hello I am running into an issue after I got php working with mysql then did a system reboot. For some reason it is not loading the php_mysqli extension after the reboot. It didn't have a problem loading before so I am confused. the line in the php.ini is uncommented and I have the file in the php directory as well as the php/ext directory and also in the apache directory. I also have the extension_dir set to php/ext. No when I run a script to see what extensions are able to load I get:

Code: Select all

PHP Version: 5.2.3
PHP OS: WINNT
Error Reporting: 6143 (E_ALL)
Register Globals: Off
Short Tags: Off
Display Errors: On
Magic Quotes GPC: On
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Config file: C:\Users\Michael\apache\php\php.ini
Loaded Extensions:
   bcmath           calendar         com_dotnet       ctype         
   session          filter           ftp              hash          
   iconv            json             odbc             pcre          
   Reflection       date             libxml           standard      
   tokenizer        zlib             SimpleXML        dom           
   SPL              wddx             xml              xmlreader     
   xmlwriter        apache2handler
This doesn't have the php_mysqli extension listed as it did before.

thanks for any help

Mike

Posted: Mon Jun 04, 2007 7:18 pm
by superdezign
Well, the way you word your question makes it seem like everything is right but... if it's not working, then it can't be.
However, it doesn't sound like anything is wrong....

Try restarting the server without a system reboot.
If that doesn't work, then post the the extensions section in your php.ini. Maybe you're calling the wrong extension file somehow.

And be sure you're editing C:\Users\Michael\apache\php\php.ini (Which you probably are, but just in case you weren't, I figured I'd throw it in there).

Posted: Mon Jun 04, 2007 7:25 pm
by bluepsykoe
Well, the way you word your question makes it seem like everything is right but... if it's not working, then it can't be.
However, it doesn't sound like anything is wrong....

Try restarting the server without a system reboot.
If that doesn't work, then post the the extensions section in your php.ini. Maybe you're calling the wrong extension file somehow.

And be sure you're editing C:\Users\Michael\apache\php\php.ini (Which you probably are, but just in case you weren't, I figured I'd throw it in there).
OK here is the extensions section of my php.ini:

Code: Select all

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.


; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
extension_dir=c:\Users\Michael\apache\php\ext\
extension=libmcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
;extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.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_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
and yeah that is C:\Users\Michael\apache\php\php.ini.
I tried restarting apache with no results and as I stated before it was working great before a system reboot.

and incase this may help at all I am running apache 2.2.4 on Windows Vista. Not sure if there are any known problems there

thanks,

Mike

Posted: Mon Jun 04, 2007 7:39 pm
by superdezign
Why is extension_dir defined so far down in your configuration file?

Anyway, try making the extension_dir a relative directory

Code: Select all

extension_dir = "./ext/"
Hopefully, that works.

Posted: Mon Jun 04, 2007 7:52 pm
by bluepsykoe
Anyway, try making the extension_dir a relative directory
Nope that didn't work.

Mike

Posted: Mon Jun 04, 2007 7:58 pm
by superdezign
Let's try this then.
Enable a different extension... Like.... The GD library (php_gd2.dll). Then, see if it shows up in the loaded extensions.

If it shows up, then the problem may be with the mysqli extension. If it doesn't, it's... something else. :?

Posted: Mon Jun 04, 2007 8:03 pm
by bluepsykoe
Let's try this then.
Enable a different extension... Like.... The GD library (php_gd2.dll). Then, see if it shows up in the loaded extensions.

If it shows up, then the problem may be with the mysqli extension. If it doesn't, it's... something else.Let's try this then.
Enable a different extension... Like.... The GD library (php_gd2.dll). Then, see if it shows up in the loaded extensions.

If it shows up, then the problem may be with the mysqli extension. If it doesn't, it's... something else.
Nope still doesn't show up. I am thinking that for some reason the php.ini file isn't being read right?

Mike

Posted: Mon Jun 04, 2007 8:12 pm
by superdezign
Right, and that could only be caused by two things (that I'm aware of).

1) The server not being restarted
2) Not editing the correct file


You're using Apache 2... Try setting the PHPIniDir to the directory with your php.ini, restart, and see if it makes a difference.

Posted: Mon Jun 04, 2007 8:57 pm
by bluepsykoe
Right, and that could only be caused by two things (that I'm aware of).

1) The server not being restarted
2) Not editing the correct file


You're using Apache 2... Try setting the PHPIniDir to the directory with your php.ini, restart, and see if it makes a difference.
Here is the code initiating php in my httpd file.
now is there a chance that maybe there is another php.ini file that I haven't come across that is messing things up?

Code: Select all

LoadModule php5_module "C:/Users/Michael/apache/php/php5apache2_2.dll"
PHPIniDir "C:/Users/Michael/apache/php/"

Posted: Mon Jun 04, 2007 9:10 pm
by bluepsykoe
OK, well I'm going to go ahead and try uninstalling and reinstalling everything and see if that fixes it I must be missing something here or inadvertently changed something. I'll try that and go from there I guess.

Mike

Posted: Tue Jun 05, 2007 4:17 am
by volka
bluepsykoe wrote:and incase this may help at all I am running apache 2.2.4 on Windows Vista.
Is it installed as a service?

please run

Code: Select all

<?php
$ini = get_cfg_var('cfg_file_path');

echo "<pre>\n";
echo 'ini: ', $ini, "\n";
echo " --- \n";
$cfg = file($ini);
foreach($cfg as $l) {
	if ( false!==strpos($l, 'mysqli') ) {
		echo $l;
	}
}
echo " --- \n</pre>";
and post the output.

Posted: Tue Jun 05, 2007 4:49 pm
by bluepsykoe
please run...and post the output.
Yes I do have apache run as a service. here is what I get for the output

Code: Select all

ini: C:\Users\Michael\apache\php\php.ini
 --- 
extension=php_mysqli.dll
mysqli.max_links = -1
; Default port number for mysqli_connect().  If unset, mysqli_connect() will use
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
; Default password for mysqli_connect() (doesn't apply in safe mode).
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
mysqli.default_pw =
mysqli.reconnect = Off
extension=php_mysqli.dll
thanks

Mike

Posted: Tue Jun 05, 2007 5:00 pm
by superdezign
That's weird. You have the mysqli extension defined twice in your php.ini file. Not sure if that'd affect it, but try deleting one of them.

Posted: Tue Jun 05, 2007 5:09 pm
by bluepsykoe
Nope that did not do anything after i deleted the second php_mysqli.dll. Now I have double checked the php.ini file, made sure it was reading the correct configuration file, made sure the extension is where I am telling the php.ini to look for it... I've even stopped and restarted the service... is there anything else I should check out?

Mike

Posted: Tue Jun 05, 2007 6:28 pm
by superdezign
Check the error log for a recurring error with PHP.