CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Resolved - PostgreSQL Solaris Coolstack

Print topic Send  topic

Author Message
trotunda


Posts: 9
Posted: 05/09/2008, 8:52 AM

I built an app with mod_perl and postgres and it works fine. I have having trouble when I build a php app out of it and load it on my Solaris 10 box running Coolstack apache, php and the CSKphplibs.

The error is:
Fatal error: Call to undefined function pg_connect() in /opt/coolstack/apache2/htdocs/ipreq/db_pgsql.php on line 76

I am a complete php newbie, but I figured I would give it a go and see where it would take me. Any help is greatly appreciated.

Tim

View profile  Send private message
wkempees


Posts: 1679
Posted: 05/09/2008, 9:59 AM

Are you using codeCharge Studio, if so what version?

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
Benjamin Krajmalnik
Posted: 05/09/2008, 10:38 AM

You need to rebuild PHP with support for Postgres.

"trotunda" <trotunda@forum.codecharge> wrote in message
news:5482473414ecd1@news.codecharge.com...
>I built an app with mod_perl and postgres and it works fine. I have having
> trouble when I build a php app out of it and load it on my Solaris 10 box
> running Coolstack apache, php and the CSKphplibs.
>
> The error is:
> Fatal error: Call to undefined function pg_connect() in
> /opt/coolstack/apache2/htdocs/ipreq/db_pgsql.php on line 76
>
> I am a complete php newbie, but I figured I would give it a go and see
> where it
> would take me. Any help is greatly appreciated.
>
> Tim
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

trotunda


Posts: 9
Posted: 05/09/2008, 12:28 PM

I am using CCS4.

The Coolstack php is supposed to have postgres support. There is a pdo_pgsql.so in my php extensions directory.
View profile  Send private message
Benjamin Krajmalnik
Posted: 05/11/2008, 10:59 PM

Run phpinfo() and see if the PostgreSQL support is there or not.
pdo_pgsql is an abstraction class not the base functions, which is what CCS
uses.

"trotunda" <trotunda@forum.codecharge> wrote in message
news:54824a5eed035c@news.codecharge.com...
>I am using CCS4.
>
> The Coolstack php is supposed to have postgres support. There is a
> pdo_pgsql.so in my php extensions directory.
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

trotunda


Posts: 9
Posted: 05/12/2008, 6:52 AM

I assume the core isn't there because this is all I found in phpinfo:

'--with-pdo-odbc=shared,unixODBC,/opt/coolstack' '--with-pdo-pgsql=shared,/usr' '--with-pear' '--with-pgsql=shared,/usr' '--with-pic' '--with-png-dir=/usr' '--with-readline=shared,/opt/coolstack'

Can postgresql core be loaded as an extension or does it have to be built in? If built in, any suggestions for a package?

Appreciate the help.

Tim
View profile  Send private message
Benjamin Krajmalnik
Posted: 05/12/2008, 9:48 AM

OK.
First of all, there is a php functions clles phpinfo() which will show you
exactly what is loaded - that is what I was referring to.
Looking at the make file, pgsql is loaded.
The question now is why you are not connecting.
take a look at pg_hba.conf and postgresql.conf to see what interface the
system is bound to and also who is allowed to connect and how.
You really have not provided much information as to how your app is trying
to connect.

"trotunda" <trotunda@forum.codecharge> wrote in message
news:548284b824ece0@news.codecharge.com...
>I assume teh core isn't there because this is all I found in phpinfo:
>
> '--with-pdo-odbc=shared,unixODBC,/opt/coolstack'
> '--with-pdo-pgsql=shared,/usr'
> '--with-pear' '--with-pgsql=shared,/usr' '--with-pic'
> '--with-png-dir=/usr'
> '--with-readline=shared,/opt/coolstack'
>
> Can postgresql core be loaded as an extension or does it have to be built
> in?
> If built in, any suggestions for a package?
>
> Appreciate the help.
>
> Tim
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

trotunda


Posts: 9
Posted: 05/12/2008, 10:31 AM

I do see the --with-pgsql and --with-pdo-pgsql, but I don't see anything else related to "pg" or "postg" in the phpinfo output. Should I not see something postgres under Core or at least Additional Modules?

This all works great with mod_perl, and in fact is currently running on the same node as the postgres cluster.

Your help is much appreciated.

Tim
View profile  Send private message
Benjamin Krajmalnik
Posted: 05/26/2008, 8:33 PM

Sorry for the delay in replying- it has been busy over here.
phpinfo() will tell you the location of php.ini.
Make sure that the extension is turned on in php.ini.
On FreeBSD, the extensions are actually defined in
/usr/local/etc/php/extensions.ini, so the extensions may be defined
elsewhere.

wisnios

Posts: 1
Posted: 05/27/2008, 1:47 AM

Hi,
you have to add:
extension="pgsql.so"
to your php.ini file (default location: /opt/coolstack/php5/lib/php.ini)

Marcin
View profile  Send private message
trotunda


Posts: 9
Posted: 05/30/2008, 8:49 AM

Quote wisnios:
Hi,
you have to add:
extension="pgsql.so"
to your php.ini file (default location: /opt/coolstack/php5/lib/php.ini)

Marcin


That did the trick! I assumed it was there because I had:

extension="pdo_pgsql.so"

but when I added the pgsql.so, it worked great!

Thanks for your help.

Tim
View profile  Send private message
wkempees


Posts: 1679
Posted: 05/31/2008, 5:13 AM

Please change topic to [TIP] or [RESOLVED]
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.