Entry
Running Apache 1.3.6, MySQL 3.22.35, and PHP 4.0.3 on Linux, I get this error: "Call to unsupported or undefined function mysql_connect()". Why? Pls!!
Mar 23rd, 2001 05:34
Mike Boucher, Gleidson Matsuda, http://www.php.net/manual/en/ref.mysql.php http://www.php.net/manual/en/install.unix.php http://www.php.net/manual/en/configuration.php
FROM PHP.net
-----------------------------------------------------------
Users who run other applications that use mysql (for example,
running php3 and php4 as concurrent apache modules, or
auth-mysql) should always specify the path to mysql:
--with-mysql=/path/to/mysql. This will force php to use the client
libraries installed by mysql, avoiding any conflicts.
use phpinfo(); to see what your mySQL setting are and if they are
enabled or not.
From my understanding, mySQL functionality was built into PHP
v4.x and that compiling with the --with-mysql is necessary when
Installing on Linux. I might be wrong about that though.
Search the documentation at PHP.net for installing PHP on
Apache/Linux.
-------------------------------------------------------------
--with-mysql[=DIR]
PHP 3: Include MySQL support. DIR is the MySQL base install
directory, defaults to searching through a number of common
places for the MySQL files.
PHP 4: Include MySQL support. DIR is the MySQL base directory. If
unspecified, the bundled MySQL library will be used. This option is
turned on by default.
-------------------------------------------------------------
FROM PHP.net
1. gunzip apache_1.3.x.tar.gz
2. tar xvf apache_1.3.x.tar
3. gunzip php-x.x.x.tar.gz
4. tar xvf php-x.x.x.tar
5. cd apache_1.3.x
6. ./configure --prefix=/www
7. cd ../php-x.x.x
8. ./configure --with-mysql --with-apache=../apache_1.3.x
--enable-track-vars
9. make
10. make install
11. cd ../apache_1.3.x
12. ./configure --activate-module=src/modules/php4/libphp4.a
13. make
14. make install
15. cd ../php-x.x.x
16. cp php.ini-dist /usr/local/lib/php.ini
17. Edit your httpd.conf or srm.conf file and add:
AddType application/x-httpd-php .php
18. Use your normal procedure for restarting the Apache server.
(You must
stop and restart the server, not just cause the server to reload by
use a HUP or USR1 signal.)
Hope this helps you out. Good luck.