Call to undefined function mysql_connect()
10,646
Solution 1
- Locate the correct
php.ini
file (checkphpinfo()
if in doubt) -
Locate the line saying
extension=php_mysql_libmysql.dll
and make sure it is uncommented (no
;
in front) - Save
- 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
)
Related videos on Youtube
Author by
coure2011
Updated on June 04, 2022Comments
-
coure2011 almost 2 years
getting error
Call to undefined function mysql_connect()
tring to run php website on IIS 7.5.