Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Recently I discovered that mysqli extension is not installed in my server Centos version 2.6. I confirm it because I change the driver of db connection from mysqli to mysql and now works fine. So, is there another way/log to determinate this problem? because the apache error_log does not say anything about it.

This really is not a problem, but it could be more complex in future. Why? because using the mysqli driver, the website die with a blank page with no errors/warnings to help me to troubleshooting it. I don't like the idea of discover the problems with magics arts or testing line per line. Should be some log file that help me to debug it.

In order provide information to help on this issue, I did:

 cat /proc/version 
 Linux version 2.6.18-308.el5.028stab099.3 (root@rhel5-build-x64) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46))
share|improve this question
    
What is the problem then? You know mysqli isn't installed and setting it to mysql seemed to solve your problem. Also, are you sure you're using CentOS version 2.6? –  Alexander Janssen Nov 2 '12 at 20:37
    
@AlexanderJanssen, I have updated the post :) –  manix Nov 2 '12 at 20:51
1  
So you want to use the mysqli driver in you PHP application? Did you try to yum install php-mysqli? Or, if you wanna check if it's installed, do a simple rpm -q php-mysqli. –  Alexander Janssen Nov 2 '12 at 20:54
    
@AlexanderJanssen, sorry for my poor explanation: it's not my native lang. I know how to install mysqli. Suppose that you don't know why your page is totally in white, exist any log file where I could see errors like [november 2, 2012] php doesn't know what mysqli is in index.php ??. With this error I can figure out that there is something wrong with mysqli and then I (or my partners) can fix it. –  manix Nov 2 '12 at 21:06
    
Sorry, I'm lost here. If your PHP application fails, the PHP code should include error messages. How to do this properly is explained in php.net/manual/en/book.errorfunc.php . –  Alexander Janssen Nov 2 '12 at 21:12

1 Answer 1

up vote 2 down vote accepted

You can confirm that mysqli is installed, or not, by listing the installed modules. SSH into your Cent OS box, and issue the following command.

php -m | grep mysqli

If nothing is returned, then you do not have mysqli.so loaded. Check if you have the shared object is installed on you system.

# Located extension dir
php -i | grep extension_dir
# List mysql.so in the path returned from the previous command
ls -la /usr/lib/php/extensions/no-debug-non-zts-20090626/mysqli.so

If the mysqli.so is present, and has the permissions -rwxr-x-rx, you'll need to load/enable the mysqli extension in the systems global php.ini file.

# Adjust path to correct php.ini file. 
# Run `php -i | grep "Configuration File"` to locate, if needed
# It might be easier to use vi, or nano, for this
sudo echo "extension=mysqli.so" >> /etc/php5/php.ini
# Restart apache
sudo service httpd restart

Else. If you do not have mysqli.so present in your system. You can install the rpm by following your systems package manager, and repeating the previous php.ini step.

sudo yum install php5-mysqli
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.