strawbilly84 Posted April 19, 2007 Share Posted April 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
strawbilly84 Posted April 19, 2007 Author Share Posted April 19, 2007 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? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 19, 2007 Share Posted April 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
strawbilly84 Posted April 19, 2007 Author Share Posted April 19, 2007 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] Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 21, 2007 Share Posted April 21, 2007 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 Quote Link to comment Share on other sites More sharing options...
strawbilly84 Posted April 24, 2007 Author Share Posted April 24, 2007 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? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 24, 2007 Share Posted April 24, 2007 Follow this FAQ. Note: That walks you through enabling the standard mysql extension. What you will want to do is use php_mysqli.dll in place of php_mysql.dll. Quote Link to comment Share on other sites More sharing options...
strawbilly84 Posted April 24, 2007 Author Share Posted April 24, 2007 I changed it and when I try to restart the server it won't restart because it can't find the dll? It is a mysql database, but I cannot find any dll's anywhere. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 25, 2007 Share Posted April 25, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.