4

I have updated my php version from php 5.0 to 5.3 and it started showing me this error

PHP Fatal error: Call to undefined function mysql_pconnect() in 

I need your help guyz please suggest me what to do.

I have also uncomment extension=mysql.so in my php ini file in

php.ini 

I am using Linux

2
  • 1
    What does your phpinfo() return? Does it include info about MySQL? Server restarted? Commented Apr 14, 2012 at 10:58
  • my PHP says '--without-mysql' i have restarted my server Commented Apr 14, 2012 at 11:16

4 Answers 4

6

Recommendation

I would recommend you use mysqli ( http://php.net/manual/en/book.mysqli.php ) which is an improved version of mysql

Quick Fix

Full Details of all possible reason available at

http://www.somacon.com/p109.php

Let me know if you need more assitance

Last Resort

Re install PHP53

Remove the 5.1.x PHP Packages:

 yum remove php php-* 

Remove the 5.3.x PHP Packages:

 yum remove php php53-* 

Install PHP5.3

yum install php53-cli yum install php53-common yum install php53-devel (If you need development support) yum install php53-gd yum install php53-mbstring yum install php53-mysql yum install php53-soap yum install php53-xml yum install php53-xmlrpc yum install php53-bcmath yum install php53-snmp 

Restart Apache

Service httpd restart 

yum search

3
  • I am using centos its about redhat and i have check all steps given on somacon but didn't got sucess :( Commented Apr 14, 2012 at 11:19
  • Ok .. i'll update my answer for another option Commented Apr 14, 2012 at 11:23
  • yep, might be necessary and quite important to restart the server as you say Commented Feb 2, 2022 at 14:43
2

This problem appears because the MySQL module is not active into your PHP installation or because the MySQL module was not compiled with permanent connections support.

In the first case you should check that the php_mysql module is enabled into the php.ini file and if not, uncomment the line which enable this module. If you are running your PHP on Linux you have to compile this module first. (--with-mysql=shared)

1
  • What is the complete command to compile mysql shared. Commented Apr 14, 2012 at 11:23
0

try to uncomment this lines and restart your server

extension = php_pdo.dll extension = php_mysql.dll extension = php_mysqli.dll extension = php_pdo_mysql.dll 
1
  • Thanks for your reply but i am using linux not windows. Commented Apr 14, 2012 at 11:20
0

Please Enable 2 extensions in your php.ini

extension=php_mysql.dll extension=php_mysqli.dll 

and please check libmySQL.dll in your php directory.

5
  • Thanks for your reply but i am using linux not windows. Commented Apr 14, 2012 at 11:25
  • same for linux too dude Commented Apr 14, 2012 at 11:26
  • linux also have directories Commented Apr 14, 2012 at 11:27
  • i didn't find any dll file in my server which you are saying.. Commented Apr 14, 2012 at 11:36
  • oh Sorry i forgot 1 thing dll r not in linux :D please go to: php.net/manual/en/mysql.installation.php Commented Apr 14, 2012 at 12:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.