Jump to content

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


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.

I changed that setting and still received the same output.  The load bar the the bottom of the screen flashes but there is no  Page output.

 

I have attached a copy of my php.ini

 

[attachment deleted by admin]

You didn't turn display_errors on in the php.ini. It is still set to off. The line you are supposed to edit is line 356 in the php.ini. By looks of it you edited line 74, which is incorrect :D

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.

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.