I recently moved to a Linux Fedora Core 2 box, and am having some issues getting PHP to work with MySQL. The host setup PHP for me, but I needed to upgrade both MySQL and PHP in order to get the additional functionality of MySQL 4+, PHP 5. Here is the configure command I am using:
'./configure' '--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-pic' '--enable-force-cgi-redirect' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config'
The problem is that MySQL and MySQLi show up in phpinfo(), but any PHP script that I call will error out with: Fatal error: Call to undefined function: mysql_connect() . I have mysql up and running, and can interact with it through the command line...just can't through PHP.
Here is the information on MySQL and MySQLi from my phpinfo().
mysql
| MySQL Support | enabled |
|---|---|
| Active Persistent Links | 0 |
| Active Links | 0 |
| Client API version | 5.0.20 |
| MYSQL_MODULE_TYPE | external |
| MYSQL_SOCKET | /var/lib/mysql/mysql.sock |
| MYSQL_INCLUDE | -I/usr/include/mysql |
| MYSQL_LIBS | -L/usr/lib -lmysqlclient |
| Directive | Local Value | Master Value |
|---|---|---|
| mysql.allow_persistent | On | On |
| mysql.connect_timeout | 60 | 60 |
| mysql.default_host | no value | no value |
| mysql.default_password | no value | no value |
| mysql.default_port | no value | no value |
| mysql.default_socket | /var/lib/mysql/mysql.sock | /var/lib/mysql/mysql.sock |
| mysql.default_user | no value | no value |
| mysql.max_links | Unlimited | Unlimited |
| mysql.max_persistent | Unlimited | Unlimited |
| mysql.trace_mode | Off | Off |
mysqli
| MysqlI Support | enabled |
|---|---|
| Client API version | 5.0.20 |
| MYSQLI_SOCKET | /var/lib/mysql/mysql.sock |
| Directive | Local Value | Master Value |
|---|---|---|
| mysqli.default_host | no value | no value |
| mysqli.default_port | 3306 | 3306 |
| mysqli.default_pw | no value | no value |
| mysqli.default_socket | no value | no value |
| mysqli.default_user | no value | no value |
| mysqli.max_links | Unlimited | Unlimited |
| mysqli.reconnect | Off | Off |
Any help would be much appreciated!
--
- Steven Michaels
[EMAIL PROTECTED]
http://www.HollowGame.com/
