Click to See Complete Forum and Search --> : Can't Get mysql functions running


anortrup
05-06-2003, 11:46 AM
I'm trying to configure php with mysql on a red hat 7.3 server. I use the following command to configure php:

./configure --enable-track-vars --enable-force-cgi-redirect --with-gettext --with-mysql

I run this command followed by make, and make install. I get no errors I then restart httpd and run my test file where I get this error:

Fatal error: Call to undefined function: mysql_connect() in /var/www/squirrelmail/index.php on line 3

What I don't understand is why the mysql functions were not compiled into the php build when I put them in the configure options?

Thanks for the help,
Andy

davidcer
05-06-2003, 05:23 PM
Andy,

how did you install MySQL? If you install from an RPM on Redhat, --with-mysql should work fine. If you installed MySQL from a binary, you should, I think, --with-mysql=/absolute/path/to/mysql
( i usually install MySQL on /sur/local, so I do --with-mysql=/usr/local/mysql)

hope it helps,

David

tsinka
05-12-2003, 10:18 PM
Hi,

you didn't include --with-apxs (or --with-apache if you also recompile apache). You now have a php executable in e.g. /usr/local/bin you can use from the command line.

Just include --with-apxs=<pathtoapxs>

I think apxs should be in the bin directory of the apache installation, it depends on the linux distribution.

Most distributions (and I think RedHat too) use php as a DSO (--with-apxs or --with-apache).

If you want to use the cgi version you would have to adjust your httpd.conf to point to the new executable (in e.g. /usr/local/bin) or to overwrite the old executable with the new one.