Call to undefined function mysql_connect()

10,646

Solution 1

  1. Locate the correct php.ini file (check phpinfo() if in doubt)
  2. Locate the line saying

    extension=php_mysql_libmysql.dll
    

    and make sure it is uncommented (no ; in front)

  3. Save
  4. Restart web server

Solution 2

Had the same problem on Windows 7 and IIS

My solution was to add a registry key where to read the php.ini from: http://php.net/manual/en/configuration.file.php

Computer needed a restart after the key was added.

Other with similar solution but for Apache Command Line PHP mysql_connect() Error

Solution 3

On Linux (Ubuntu here specifically) make sure the package php5-mysql is installed. (And restart apache after doing so, with service apache2 restart or /etc/init.d/apache2 restart)

Share:
10,646

Related videos on Youtube

coure2011
Author by

coure2011

Updated on June 04, 2022

Comments

  • coure2011
    coure2011 almost 2 years

    getting error

    Call to undefined function mysql_connect()
    

    tring to run php website on IIS 7.5.