Fatal error: Call to undefined function mysql_connect()
<p>I am getting this error Fatal error: Call to undefined function mysql_connect() in /var/www/html/test1.php on line 8 
for the following code:</p>

<pre><code>&lt;?php
$host = "localhost";
$user = "user12";
$pass = "34klq*";
ini_set ('display_errors', 1);
$r = mysql_connect($host, $user, $pass);
if (!$r) {
echo "Could not connect to server\n";
trigger_error(mysql_error(), E_USER_ERROR);
} else {
echo "Connection established\n";
}
echo mysql_get_server_info() . "\n";
mysql_close();
?&gt;
</code></pre>

<p>I have PHP, MYSQL, php-Mysql installed in my system:</p>

<pre><code>[root@localhost ~]# rpm -qa | grep mysql
php-mysql-5.3.3-3.el6_2.8.i686
mysql-devel-5.1.61-4.el6.i686
mysql-server-5.1.61-4.el6.i686
mysql-bench-5.1.61-4.el6.i686
mysql-libs-5.1.61-4.el6.i686
mysql-5.1.61-4.el6.i686

[root@localhost ~]# rpm -qa | grep php 
php-common-5.3.3-3.el6_2.8.i686
php-5.3.3-3.el6_2.8.i686
php-mysql-5.3.3-3.el6_2.8.i686
php-cli-5.3.3-3.el6_2.8.i686
php-pdo-5.3.3-3.el6_2.8.i686
</code></pre>

<p>output of phpinfo() :
<a href="http://jsfiddle.net/nit8899/GZ4f7/" rel="nofollow">http://jsfiddle.net/nit8899/GZ4f7/</a></p>

<p>Also I have edited the <code>/etc/php.ini</code> file:</p>

<pre><code>extension=mysql.so
</code></pre>

<p>But even then I am getting this error.</p>
