Subject: Problems with Apache, MySQL and PHP3
To: None <port-i386@netbsd.org>
From: Eric Delcamp <e.delcamp@wanadoo.fr>
List: port-i386
Date: 08/26/2000 11:30:35
Hi !

I have installed from packages Apache Web server, MySQL and PhP3:

root.gedeon:~> pkg_info
trying PKG_PATH /usr/tarballs
apache-1.3.11       The Apache web server (http://www.apache.org/)
trying PKG_PATH /usr/tarballs
mysql-client-3.22.32 MySQL, a free SQL database (client)
trying PKG_PATH /usr/tarballs
mysql-server-3.22.32 MySQL, a free SQL database (server)
trying PKG_PATH /usr/tarballs
php-3.0.7           PHP3 HTML-embedded programming language with database
connec
trying PKG_PATH /usr/tarballs
php-mysql-3.0.7     PHP3 extension for MySQL databases
trying PKG_PATH /usr/tarballs
ap-php-3.0.7        PHP3 server module for Apache

(Side note, how to avoid the annoying "trying PKG_PATH /usr/tarballs"
messages ? /usr/tarballs is where I put .tgz archives)

PhP3 itself work well, I can generate HTML pages on fly. But when I'm trying
to use MySQL access with this script, I get error :

<HTML>
<HEAD><TITLE>Test de PHP</TITLE></HEAD>
<BODY>
<?
 $link = mysql_pconnect("localhost", "root", "")
  or exit();
 mysql_select_db ("web")
  or exit();
 $result = mysql_query("SELECT COUNT(*) FROM perso")
  or exit();
 if ($row = mysql_fetch_array($result))
  echo("<P>La base contient ".$row[0]." membres";
 mysql_free_result($result);
?>
</BODY>
</HTML>

Fatal error: Call to unsupported or undefined function mysql_pconnect() in
/export/partage/Web/www_root/test.php3 on line 5

Should I install package in a certain order ? I have read the docs, and have
modified httpd.conf like suggested (in fact, PHP3 work). I dont find a
configuration file for PHP3, except php3.ini :

#       $NetBSD: php3.ini.example,v 1.1 1999/05/03 21:35:06 tv Exp $

extension_dir=/usr/pkg/lib/php3
root.gedeon:/usr/pkg/etc>

Any suggestions ?