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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.