Jump to content

problems using mysqli


miwillans

Recommended Posts

Hiya,

I am a total newbie to php and am having a spot of trouble. I am using PHP Version 5.2.9-2 and MySQL 5.1 on a vista machine using IIS 7. I can bring up the phpinfo() on my computer and can connect to my database using the mysql_connect command but if I try to use mysqli I just get a server error 500-Internal server error message. I have checked the extension in the php.ini file and that has the semicolon removed and the extension_dir is pointing at the right place. Does anyone have any idea as to what I am doing wrong??

Link to comment
https://forums.phpfreaks.com/topic/153349-problems-using-mysqli/
Share on other sites

How did you obtain and install php? The .msi installer or the full .zip package?

 

Did you stop and start the IIS service to get any change made to php.ini to take effect?

 

Is php using the php.ini that you are changing? What does the phpinfo() statement show for - Loaded Configuration File?

 

And for your 500 server error, please set error_reporting to E_ALL and display_errors to ON in your php.ini so that you will get immediate feedback for errors that php detects.

I downloaded php from php.net and used the .msi installer.

 

The whole system has been restarted, to enable the changes to take place, but this still has had no effect.

 

The phpinfo() shows the right php.ini file is being used for the loaded configuration file.

 

I have set error reporting up as you suggested. i used the following to connect.

 

<?php

$mysqli = new mysqli("localhost", "user", "password", "database");

printf("Mysql error number generated: %d". $mysqli->errno);

?>

 

 

all i got was the same error message

Server Error 500 - Internal server Error. There is a problem with the resource you are looking for, and  it cannot be displayed.

The .msi installer is bad news. You must use the Windows control panel add/remove to add php extensions. I am also pretty sure that it dumps a bunch of settings in to the Windows registry which override the settings you put into php.ini, which is probably why the errors about the mysqli extension did not start showing up when you changed the php.ini

 

If you can, you should manually install php from the .zip package and if there is no good reason why you are using IIS, you should switch to Apache.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.