Apache 2.2 w/ PHP 5.1.2 and PostGreSQL 8.1

Apache 2.2 w/ PHP 5.1.2 and PostGreSQL 8.1

am 05.03.2006 02:21:32 von Stuart

Folks,

I recently upgraded to Apache 2.2 w/ PHP 5.1.2 to connect to my PostGreSQL
8.1 databases on a SuSE 10.0 system. I used the rpm's provided by SuSE to
install the Apache and PHP packages . Apache works fine and phpinfo() shows
all the normal info except the section on additional modules is empty. I am
not sure if this is normal.

I get the following error and cannot figure out why pgsql module is not
loading.

PHP Fatal error: Call to undefined function pg_connect()

Can anyone help with this?

Thanks,

Stuart

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Re: Apache 2.2 w/ PHP 5.1.2 and PostGreSQL 8.1

am 05.03.2006 07:25:24 von Chris Smith

On 3/5/06, Stuart wrote:
> Folks,
>
> I recently upgraded to Apache 2.2 w/ PHP 5.1.2 to connect to my =
PostGreSQL
> 8.1 databases on a SuSE 10.0 system. I used the rpm's provided by SuSE =
to
> install the Apache and PHP packages . Apache works fine and phpinfo() sh=
ows
> all the normal info except the section on additional modules is empty. I=
am
> not sure if this is normal.
>
> I get the following error and cannot figure out why pgsql module is not
> loading.
>
> PHP Fatal error: Call to undefined function pg_connect()

That means php doesn't know what pg_connect is.

See if you need to install a php-pgsql rpm, then restart apache (it
should show "postgresql" in the phpinfo page now).

--
Postgresql & php tutorials
http://www.designmagick.com/

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Re: Apache 2.2 w/ PHP 5.1.2 and PostGreSQL 8.1

am 05.03.2006 19:41:22 von Stuart Barbee

Chris,

Yes, I have the php-pgsql rpm installed along with
many others. I checked the location of the extensions
and they match where php expects them to be (according
to php.ini and phpinfo()). Any other suggestions as
to that might be the problem? I am just wondering if
SuSE team broke something in the new version of Apache
2.2 or version of php.

Thanks,=20

Stuart



--- chris smith wrote:

> On 3/5/06, Stuart wrote:
> > Folks,
> >
> > I recently upgraded to Apache 2.2 w/ PHP
> 5.1.2 to connect to my PostGreSQL
> > 8.1 databases on a SuSE 10.0 system. I used the
> rpm's provided by SuSE to
> > install the Apache and PHP packages . Apache
> works fine and phpinfo() shows
> > all the normal info except the section on
> additional modules is empty. I am
> > not sure if this is normal.
> >
> > I get the following error and cannot figure out
> why pgsql module is not
> > loading.
> >
> > PHP Fatal error: Call to undefined function
> pg_connect()
>=20
> That means php doesn't know what pg_connect is.
>=20
> See if you need to install a php-pgsql rpm, then
> restart apache (it
> should show "postgresql" in the phpinfo page now).
>=20
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>=20


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Re: Apache 2.2 w/ PHP 5.1.2 and PostGreSQL 8.1

am 05.03.2006 19:50:21 von Stuart Barbee

Horacio,

I was thinking it could be something like that but
have not found a parameter that seems to affect that
yet. The SuSE team compiles the extenstions
separately and puts an include statement into the
php.ini to insert an *.ini file for each extension.=20
Supposedly you can comment the php-pgsql.ini file to
exclude the extension. The extension is not
commented, so I am not sure what could be wrong.=20
Maybe something is broken here. Do you know anyone
using this combination of packages (Apache 2.2 w/ APR
1.0, PHP 5.1.2 and PostGreSQL 8.1) and have it working
ok?

Stuart


--- Horacio Degiorgi wrote:

> check your php.ini, there must to be uncommented the
> extension for postgresql
> after correct that you need to reload apache to
> apply the changes.
>=20
>=20
>=20
> On 3/4/06, Stuart wrote:
> > Folks,
> >
> > I recently upgraded to Apache 2.2 w/ PHP
> 5.1.2 to connect to my PostGreSQL
> > 8.1 databases on a SuSE 10.0 system. I used the
> rpm's provided by SuSE to
> > install the Apache and PHP packages . Apache
> works fine and phpinfo() shows
> > all the normal info except the section on
> additional modules is empty. I am
> > not sure if this is normal.
> >
> > I get the following error and cannot figure out
> why pgsql module is not
> > loading.
> >
> > PHP Fatal error: Call to undefined function
> pg_connect()
> >
> > Can anyone help with this?
> >
> > Thanks,
> >
> > Stuart
> >
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 6: explain analyze is your friend
> >
>=20
>=20
>=20
> --
> Horacio Degiorgi
> http://blog.codigophp.com
> Mendoza - Argentina
>=20


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Re: SOLVED Apache 2.2 w/ PHP 5.1.2 and PostGreSQL 8.1

am 07.03.2006 20:56:12 von Stuart Barbee

Folks,

After looking through the log files, I found that Novell's Apparmor (using
the SubDomain package) was rejecting Apache's requests to access the
directory where php stores its shared modules. These errors showed up
in /var/log/messages, but not in the php or apache log.

kernel: SubDomain: REJECTING r access to /etc/php5/conf.d
(httpd2-prefork(7576) profile /usr/sbin/httpd2-prefork
active /usr/sbin/httpd2-prefork)
....
kernel: SubDomain: REJECTING r access to /usr/lib64/php5/extensions/pgsql.so
(httpd2-prefork(10857) profile /usr/sbin/httpd2-prefork
active /usr/sbin/httpd2-prefork)
....
kernel: SubDomain: REJECTING w access to /tmp/.s.PGSQL.5432
(httpd2-prefork(11309) profile /usr/sbin/httpd2-prefork
active /usr/sbin/httpd2-prefork)

Once I authorized the application to access those directories and files, all
worked well -- sort of, but that's another problem.

Thanks for the input,

Stuart

On Sunday 05 March 2006 01:25, chris smith wrote:
> On 3/5/06, Stuart wrote:
> > Folks,
> >
> > I recently upgraded to Apache 2.2 w/ PHP 5.1.2 to connect to my
> > PostGreSQL 8.1 databases on a SuSE 10.0 system. I used the rpm's
> > provided by SuSE to install the Apache and PHP packages . Apache works
> > fine and phpinfo() shows all the normal info except the section on
> > additional modules is empty. I am not sure if this is normal.
> >
> > I get the following error and cannot figure out why pgsql module is not
> > loading.
> >
> > PHP Fatal error: Call to undefined function pg_connect()
>
> That means php doesn't know what pg_connect is.
>
> See if you need to install a php-pgsql rpm, then restart apache (it
> should show "postgresql" in the phpinfo page now).
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend