Trouble configuring PHP for use with MySQL
Moderator: General Moderators
Trouble configuring PHP for use with MySQL
After enabling MySQL in the .ini, it still doesn't work. Any page that I try to use MySQL in won't yield anything but a blank screen, but no outright errors. phpinfo doesn't say that MySQL module is enabled. Any suggestions?
Re: Trouble configuring PHP for use with MySQL
show/tell us:
- few lines around the line where did you enabled MySql
- your platform... windows/Linux?
- some of the code that you are using for testing
in your php.ini what is the value of the variable "extension_dir" ?
are you sure that in the folder indicated in extension_dir you have the php_mysql.dll or php_mysqli.dll ?
- few lines around the line where did you enabled MySql
- your platform... windows/Linux?
- some of the code that you are using for testing
in your php.ini what is the value of the variable "extension_dir" ?
are you sure that in the folder indicated in extension_dir you have the php_mysql.dll or php_mysqli.dll ?
Re: Trouble configuring PHP for use with MySQL
Code: Select all
<?php
$mysqli = new mysqli("localhost", "root", "pass", "DB");
if (mysqli_connect_errno()){
printf("connection failed: %s\n", mysqli_connect_error());
exit();
} else {
printf("host information %s\n", mysqli_get_host_info($mysqli));
mysqli_close($mysqli)}
?>on windows.
Code: Select all
extension_dir = "./"Re: Trouble configuring PHP for use with MySQL
for sure it is the problem.Bacu wrote:There is no php_mysql.dll or php_mysqli.dll, I'm guessing that's part of the problem.
- your extension_dir must point to the "ext" folder under your PHP directory installation
- php_mysql.dll or php_mysqli.dll (ideally both but only 1 is required.. looking your code you need the second one) must be present under the "ext" directory.
set it up and be sure to re-start Apache and check again with phpinfo()
Re: Trouble configuring PHP for use with MySQL
php_mysqli.dll is in /ext
changed extension_dir to C:\php\ext
Still nothing.
changed extension_dir to C:\php\ext
Still nothing.