By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,613 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,613 IT Pros & Developers. It's quick & easy.

php and MS-SQL and PostgreSQL (with Apache)

P: n/a
Hi,
I have an architectural type question that centers around php.
We have a website that people hit that uses php to dynamically
generate
web pages. We use Apache and php (although we don't have php compiled
in with apache). Our Unix like server (FreeBSD) that has php (and
Apache) on it that today communicates with the postgresql database on
another Unix like server (Linux). I configured the php set of
libraries with postgresql support in them.

(Unix server) (Unix server)
[Apache + PHP ] -----> [ postgresql ]
-
-
- (Win 2003)
[ MS SQL 200 ]

We are adding a Windows server into our system that contains MS-SQL
2000 on
it with another database to interact with. My question is to access
both databases from the php server (freebsd), is it only a matter of
compiling php with postgresql and mssql support in it or are there
other things to consider? I know there are different function calls
for each database type and even a PEAR interface that handles
different databases with a common interface. I am just looking at my
configurtion options/possibilities.

Thanks in advance

Mike
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Mike!

On 11 Nov 2003 11:13:06 -0800, mi*****@hotmail.com (Mike) wrote:
Hi,
I have an architectural type question that centers around php.
We have a website that people hit that uses php to dynamically
generate
web pages. We use Apache and php (although we don't have php compiled
in with apache). Our Unix like server (FreeBSD) that has php (and
Apache) on it that today communicates with the postgresql database on
another Unix like server (Linux). I configured the php set of
libraries with postgresql support in them.

(Unix server) (Unix server)
[Apache + PHP ] -----> [ postgresql ]
-
-
- (Win 2003)
> [ MS SQL 200 ]

We are adding a Windows server into our system that contains MS-SQL
2000 on
it with another database to interact with. My question is to access
both databases from the php server (freebsd), is it only a matter of
compiling php with postgresql and mssql support in it or are there
other things to consider? I know there are different function calls
for each database type and even a PEAR interface that handles
different databases with a common interface. I am just looking at my
configurtion options/possibilities.


I don't think there is much of a problem other than smaller ones with
each of the databases.

I have Informix and MSSQL compiled as extensions here and it works
fine. There is also a patch, which lets you write the microseconds
into SQl server datetimes. I can send it to you on request. I think it
has still not made it into PHP, I don't know why.

Jochen



Thanks in advance

Mike


--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2

P: n/a
Jochen Daum wrote:
fine. There is also a patch, which lets you write the microseconds
into SQl server datetimes. I can send it to you on request. I think it
has still not made it into PHP, I don't know why.


Hi Jochen, I wouldn't mind this patch. I use Oracle, PostegreSQL, MySQL,
and MS-SQL at work and I wouldn't mind being able to keep everything in
seconds/microseconds.

Thanks!

Jul 17 '05 #3

P: n/a
Doesn't sound like there are too many issues on the face of it. My
advice is to just do it. I still recomend the use of PEAR (or some other
similar abstraction thing for which there are a few). While there will
still be implementation differences, you can still potentially save
yourself lots of work.

I'm not sure what the performance comparrisons are between MSSQL and
PostgreSQL, but I know I prefer working with Postgres -- it's much more
powerful allowing you to choose a range of languages to use for stored
procedures including C and perl. I also prefer sequences to MS's
"identities". If it were up to me, I'd port the MS database to postgres
:) But then you probably have other windows apps talking to it so you can't.

My only real advice is to make sure you've tuned the postgres box, it
makes a BIG difference to performance. I think this is simply a case of
adjusting the buffer size it is allowed to use. By default, it is
usually set too low. It all depends on how much that box can afford to
give it without impacting on it's other processes. Of course then there
are other issues like indexing and so forth.

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.