Entry
My browser send this error Fatal error: Call to undefined function: mysql_connect() in /var/www/html
Mar 28th, 2008 17:52
ha mo, Philip Olson, Jaime, http://www.php.net/mysql
This is because your PHP lacks MySQL support so it does not have the
MySQL functions available. PHP has many extensions, from FTP to COM,
from MySQL to ZIP, MING to CURL, and hundreds more. Most of these are
not enabled by default.
If your PHP lacks a certain extension, that extensions functions will
be undefined. In this case, MySQL is not enabled so all MySQL
functions are undefined. You must recompile your PHP (or use RPM's or
include .so/.dll's) to enable MySQL support.
If you're using RPM's, you essentially need to install three RPM's.
They go by different names but essentially:
- php
- mysql
- php-mysql
If you're not using RPM's, you must manually recompile PHP as per the
installation instructions in the PHP manual:
http://www.php.net/manual/en/install.unix.php
Use of --with-mysql is the default in PHP 4, in PHP 5 you must
explicitly call --with-mysql as it's not enabled by default.
The Windows distibution of PHP 4 has MySQL enabled by default so you
can't (without much effort) disable it. In PHP 5 you must include the
appropriate mysql dll's, see the manual and below link for details.
Be sure to restart your webserver (such as Apache or IIS) after making
these changes.
Related faqts:
Where did MySQL go? I'm using PHP 5.
http://www.faqts.com/knowledge_base/view.phtml/aid/23162/fid/1150
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com