Error when connecting to MySql via php4
mysql_connect("localhost", "root", "*") or exit();
I get the error message:
Fatal error: Call to undefined function: mysql_connect() in /var/www/htdocs/index.php on line 36
Then I tried:
apt-get install php4-mysql
but I still get the same error message.
Any ideas?? Thanks.
4 Replies
Risto
'../configure' '–prefix=/usr' '--with-apxs=/usr/bin/apxs' '--with-regex=php' '--with-config-file-path=/etc/php4/apache' '--disable-rpath' '--disable-debug' '--enable-memory-limit' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db2' '--with-iconv' '--with-ndbm' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext' '--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop' '--enable-sockets' '--enable-wddx' '--with-xml=/usr' '--with-expat-dir=/usr' '--enable-yp' '--with-zlib' '--without-pgsql' '--disable-static' '--with-layout=GNU' '--with-curl=shared,/usr' '--with-dom=shared,/usr' '--with-zlib-dir=/usr' '--with-gd=shared,/usr' '--with-jpeg-dir=shared,/usr' '--with-xpm-dir=shared,/usr/X11R6' '--with-png-dir=shared,/usr' '--with-freetype-dir=shared,/usr' '--with-imap=shared,/usr' '--with-ldap=shared,/usr' '--with-mcal=shared,/usr' '--with-mhash=shared,/usr' '--with-mm' '--with-mysql=shared,/usr' '--with-unixODBC=shared,/usr' '--with-recode=shared,/usr' '--enable-xslt' '--with-xslt-sablot=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-sybase-ct=shared,/usr' '--with-ttf=shared,/usr' '--with-t1lib=shared,/usr'
You can see it has '--with-mysql=shared,/usr' in there. Dunno if that's sufficient….
I compiled php manually and I have to load the extension manually in php.ini in order to get it work.
You should have a line like:
extension=mysql.so
in your ini file. Be sure to point the extension_dir to the dir where your extensions are located.
Hope this help.
Kevin
extension=mysql.so
line in php.ini. But when I just checked it, it wasn't there. I must have forgot to save it…..hmmm. It works fine now. Thanks.