Jump to content

PHP.INI proble with MYSQL no server connection blank page desplayed


strawbilly84

Recommended Posts

I am using php 5 and mysql server 5.

 

when I put in this code into a php file

 

[pre][pre]<?php

$mysqli = mysqli_connect("localhost", "Bill", "bill", "testDB");

 

if (mysqli_connect_errno()) {

printf("Connect failed: %s\n", mysqli_connect_error());

exit();

} else {

printf("Host information: %s\n", mysqli_get_host_info($mysqli));

}[/pre][/pre]

 

?>

 

I get no response at all from the DB. My apache server is working fine being that I can run other php scripts.  I edited the php ini file and turned on mysql related things.  I also set the default port, and path.

 

The server does not seem to be interpreting the php code, as I get a blank page.

A little more information that may help.  My apache server is installed on WinXp home.  In the file directory c:server/apache2.  Mysql is installed in the apache2 folder (thats the folder that has my.ini).  Did I install mysql in the wrong directory?

Turn a setting called display_errors to On and ensure that error_reporting is to to E_ALL in the php.ini

 

Save the php.ini and restart Apache. Re run that code.

 

if you get an error like Call to undefined function mysqli_connect then please read this FAQ. If you don't get any think like that then post all error messages here in full.

Thanks for you help.  I am now getting an error message (which is better then nothing).

 

The error is: Fatal error:

 

Call to undefined function mysqli_connect() in C:\server\Apache2\test.php on line 8

 

 

any suggestions?

What PHP distribution did you use when you installed PHP? Did you download the PHP installer or the zipped binaries?

 

If you downloaded the PHP Installer and installed PHP that way, then download the zipped binaries and extract the contents of the zip to where you installed PHP. Make sure you overwrite existing files too.

 

The installer doesn't install the same files as the zipped binary distribution.

 

Also make sure you are using PHP5 and not PHP4. MySQL Improved is not available for PHP4.

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.