there are various reason why you may get this error.
- Verify that your installation of PHP has been compiled with mysql support.
- In Linux, the line is
and in Windows, the line is
- Check if the php-mysql package is installed by opening a terminal window (bash), and typing,
rpm -qa | grep php
. If you don’t see it, make a note of the exact version of PHP that is installed.
- If Not Install php-mysql (yum install php-mysql – centos)
- The last step is to restart Apache. You can do this with one of the following commands,