many connection to mysql from apache module

many connection to mysql from apache module

Post by s.. » Wed, 16 Aug 2000 14:27:55



I am programming in C, and new to the apache module concept.
I created an apache module that in the child_init connect to a mysql
db. It give me much better results than a CGI that connect every
execution.
Now I would like to do another module (or another 10 modules) that all
connecting to the same database, but if I will do a connect in each
module child_init I will create ton of connection to the db. (let's say
apache fork 300 httpd, and I have 10 module => 3000 db connections!)
How can I share the connection between each of my module?
can I create some 'global' that will have some thing like
MYSQL MySQL;
MYSQL *m_sock=&MySQL; , and all my module will work with m_sock somehow?
if yes where to init it?
If I am asking in the wrong place or you know a page/book I can read
please let me know
Thanks,
Shai

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Apache, PHP, and MySQL module probs

I need to get php with MySQL support running on my LinuxPPC box. Install of
LinuxPPC 2k went fine. Install of MySQL (from www.mysql.com, ppc rpms) went
fine. I deinstalled the distributed rpms for Apache and PHP. Then I went to

ftp://ftp.linuxppc.com/contrib/software/System%20Environment/Daemons/

and downloaded the following:

apache-1.3.12-1.ppc.rpm
php-3.0.13-1.ppc.rpm
php-imap-3.0.13-1.ppc.rpm
php-ldap-3.0.13-1.ppc.rpm
php-MySQL-3.0.13-1.ppc.rpm

and installed them. Everything seems to have installed OK. Edited my
httpd.conf to load the php module, and edited the php.ini file to load the
imap, ldap, and mysql modules.

Here's where it gets weird. With the imap and ldap modules, everything works
fine. As soon as I load the mysql module, things get truly weird - random
php functions stop working (such as phpinfo() for example). If I disable
MySQL, everything works fine.

Anyone have any idea what's going on?
--

2. Linux as a print server

3. In Apache Module use MySQL connect error

4. NEC SuperScript 660 -- Help!!

5. mysql connection problems (localhost connection)

6. cgi programer needed

7. Apache / PHP4 / MySql Problem - Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock'

8. SMS software for AIX.

9. Connection pooling with JDBC(apache SSL module) to Oracle?

10. apache: module post-process output of another module?

11. Apache module or PHP module ?

12. How to build PHP as DSO module with external MySQL?

13. Need Help compiling Msql-Mysql-modules-1.2219