Koozali.org: home of the SME Server

php-postgres

Offline BlueLake

  • ***
  • 56
  • +0/-0
php-postgres
« on: January 19, 2014, 05:58:19 PM »
which command do I enter to install pdo-pgsql.so so far I have tried every conceivable thing I can think of including just about every google item there is in every forum I can find. When I enter yum install php5-pgsql I get the message "no package php5-ggsql available" so I have tried all variations on the theme with the same result...It is actually easier to walk on water than do anything with postgresql in SME ver 8

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: php-postgres
« Reply #1 on: January 19, 2014, 06:47:44 PM »
BlueLake

Considering your name, it's probably easier for you to walk on water, but for others, it's probably easier to nominate a suitable repo (repository) that has the required package.
That package is not in the standard repos that SME server uses by default, that's why the command you used is not finding & installing it.
I do not know where php5-pgsql is, or if it exists, but you might try epel, or dag or atrpms or webtatic repos.

If you can tell us where that package is, then we can tell you how to install it on SME server

Then you install it using a command like
yum install --enablerepo=epel php5-pgsql
(assuming you have first configured epel repo on your sme server & second that the package is in that repo, replace repo name as appropriate).
 
See the FAQ, link at top of forums, Section 1 Installation, for everything you need to know about repos, how to add & enable them etc.
particularly
http://wiki.contribs.org/SME_Server:Documentation:FAQ:Section01#Other_popular_repositories
and
http://wiki.contribs.org/Category:Yum_Repository
 
Be aware you may have compatibility & dependency issues installing additional packages like that, so proceed carefully.

I checked & it's not in dag, epel, webtatic or atrpms (for 32 bit system, there might be a 64 bit pkg if your system is 64 bit, so try), otherwise you will have to search around for it.
If you configure all those repos on SME, then run the command suggested (modified to suit each repo), & it will show you if that pkg is available or not, you can cancel the install also.

I googled & found rpm.pbone.net & rpmfind.net has a 64 bit pkg, so download it to a empty folder on your sme server & do a local yum install

wget http://websiteURLpath/filename.rpm
yum localinstall fullpackagename.rpm
signal-event post-upgrade
signal-event reboot
« Last Edit: January 20, 2014, 01:09:14 AM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline BlueLake

  • ***
  • 56
  • +0/-0
Re: php-postgres
« Reply #2 on: January 19, 2014, 07:24:48 PM »
Hi Janet and thanks for the reply
 Ok some history - first my original sme was ver 7 which I was able to install and use, following one of the published how to's. This box is was upgraded to ver 8 and is now giving some errors - up to this point great. Some time ago I decided to do a fresh install of ver 8, no problems so far - then tried to install postgresql 9+ which was impossible. So gave up.

 Now my original box is causing problems so decided once again to install a fresh copy of ver 8 and keep the postgresql DB on another linux server,  but to do this I need to install pgsql.so for php 5.3 (to read the postgresql DB) which isn't happening. Looking at every posting I have been able to find for centos etc... all say to "yum install php5-pgsql" Ok this i did, but the error (see original post) was displayed...again back to google searching for other examples, all of which were tried and all with the same result. What I need is a line in the php.ini which says "extension=pgsql.so" (which I have) for things to work, then reboot apache. Which is how I did it with the original ver 7. This is a clean 64 bit install of ver 8...

So...your bottom line will be something like wget http the rpm.bone etc... :???:   

Offline BlueLake

  • ***
  • 56
  • +0/-0
Re: php-postgres
« Reply #3 on: January 20, 2014, 09:30:40 AM »
Hi
Could I just copy the required file from another machine...would that work? or rpmseeek.com have a 64 bit file

Thanks

Offline Xavier.A

  • ****
  • 104
  • +0/-0
Re: php-postgres
« Reply #4 on: January 20, 2014, 11:19:53 AM »
hi,

Do u want to install phppgadmin?

First step :
have a look here  : http://blog.ansoult.fr/co/Installer_PostgreSQL92_sur_SME_Server_8.html
I did'nt test PosgreSQL 9.3 but it must be possible to install it on SME8, the wiki page will be updated soon (i will try, if i can :-) )

Second step :
Tell us about your yum repos already installed in your SME8
db yum_repositories show | grep repository

in my SME8s :
webtatic-el5=repository >> http://wiki.contribs.org/Webtatic
Atomic's repos seems to be a good choice too but i did'nt test it yet >>> http://wiki.contribs.org/Atomic

Tell us about your php RPMs already installed :
yum list installed | grep php
or
rpm -q -a --qf "%{Name}:%{Vendor}\n"| grep php

yum --enablerepo=webtatic-el5 search php-pgsql
yum --enablerepo=webtatic-el5 info php-pgsql

if it s good for u
yum --enablerepo=webtatic-el5 install php-pgsql

Done !

For PostgreSQL admin tools, may be u should look at pgadmin : http://www.pgadmin.org/

Xavier
“When the wise man points to the moon, the fool looks at the finger.”

Offline BlueLake

  • ***
  • 56
  • +0/-0
Re: php-postgres
« Reply #5 on: January 20, 2014, 12:15:43 PM »
Hi

I want php to read a postgresql database - to do this it requires pdo_pgsql.so in /usr/lib64/php/modules

I have given up trying to install any version of postgresql 9+ onto sme 8 its next to impossible

listed repos are...

addons
base
centosplus
contrib
extras
smeaddons
smecontribs
smedev
smeextras
smeos
smetest
smeupdates
smeupdates-testing
updates

yum --enablerepo=webtatic-el5 (search/info/install) php-pgsql = "repository not found"
--enablerepo=webtatic = "command not found"
 :sad:

Offline Xavier.A

  • ****
  • 104
  • +0/-0
Re: php-postgres
« Reply #6 on: January 20, 2014, 01:04:29 PM »
did u really read the last post?   :-o

u have to go there http://wiki.contribs.org/Webtatic and to install the webtatic repos or u won't be able to install php-pgsql

and after
yum --enablerepo=webtatic-el5 (search/info/install) php-pgsql


“When the wise man points to the moon, the fool looks at the finger.”

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: php-postgres
« Reply #7 on: January 20, 2014, 01:08:14 PM »
This appears to pretty definitive: http://wiki.postgresql.org/wiki/YUM_Installation

This installs in a SME9b3 box:
yum install php-pdo php-pgsql

All standard repos, nothing extra
« Last Edit: January 20, 2014, 01:18:06 PM by TerryF »
--
qui scribit bis legit

Offline Xavier.A

  • ****
  • 104
  • +0/-0
Re: php-postgres
« Reply #8 on: January 20, 2014, 02:01:53 PM »
I'm agree  :)

but he is still in SME8 (el5), no? Blue?
“When the wise man points to the moon, the fool looks at the finger.”

Offline BlueLake

  • ***
  • 56
  • +0/-0
Re: php-postgres
« Reply #9 on: January 20, 2014, 02:36:42 PM »
Hi X.Ansoult and Terry.F

Yes X.Ansoult I had read your post but obviously misread AND misunderstood a few things notably the --enablerepo=webtatic bit which  did and tried to work out the next bit in the box below which starts /sbin/e-smith and wondered how I was supposed to copy that to the server :-? but reading again i noticed the installation command bit (which  missed the first time) and now I have what I was after--Thanks and much appreciated...:lol:

 Terry.F I tried what u suggested and that install always defaults to 8.4 - and then gives error messages something like "postgresql91-server not available". I have tried several different googled post but all with the same result notably
( www.davidghedini.com/pg/entry/install_postgresql_9_on_centos ) which is very similar and still the same results...You can Install 9+ easily on ubuntu 12.4 server which I find very confusing because higher up the chain it is still fedora.

Thanks again for your help both of you (and Janet too) I will be able to sleep tonight now... :lol: 

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: php-postgres
« Reply #10 on: January 20, 2014, 05:46:33 PM »
BlueLake

In cae you have not yet understood what to do yet.

Note the rpms available are
php-pgsql
and
php53-pgsql
I assume one is v5 php, the other is v5.3 php, so choose which you need.

Login to your sme server command prompt as root or as a user with root privileges

Configure the webtatic repo using this command, in a Putty ssh window, you can copy from here & paste to the "dos style" command prompt using the mouse.

Copy all the following as one command, or type it exactly as shown, pressing Enter key at the end of each line
Code: [Select]
/sbin/e-smith/db yum_repositories set webtatic repository \
Name 'webtatic - EL5' \
MirrorList 'http://mirror.webtatic.com/yum/centos/5/$basearch/mirrorlist' \
EnableGroups no \
GPGCheck yes \
GPGKey http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy \
Visible no \
status disabled

Then do
Code: [Select]
signal-event yum-modify
Then do
Code: [Select]
yum --enablerepo=webtatic search php-pgsqlwhich gives you (on a 32 but system, might be slightly different for 64 bit)
php-pgsql.i386 : A PostgreSQL database module for PHP.
php53-pgsql.i386 : A PostgreSQL database module for PHP

So you initially steered us in the wrong direction asking for php5-pgsql as that does not exist.

To install do one of tge following
Code: [Select]
yum --enablerepo=webtatic install php-pgsql
yum --enablerepo=webtatic install php53-pgsql

You may also see a lot of dependencies that need to be installed, these will depend on your system
eg
Dependencies Resolved

================================================================================
 Package              Arch         Version               Repository        Size
================================================================================
Installing:
 php-pgsql            i386         5.3.28-2.w5           webtatic          72 k
Updating for dependencies:
 php                  i386         5.3.28-2.w5           webtatic         1.4 M
 php-cli              i386         5.3.28-2.w5           webtatic         2.7 M
 php-common           i386         5.3.28-2.w5           webtatic         664 k
 php-devel            i386         5.3.28-2.w5           webtatic         632 k
 php-gd               i386         5.3.28-2.w5           webtatic         107 k
 php-imap             i386         5.3.28-2.w5           webtatic          49 k
 php-ldap             i386         5.3.28-2.w5           webtatic          34 k
 php-mbstring         i386         5.3.28-2.w5           webtatic         1.2 M
 php-mysql            i386         5.3.28-2.w5           webtatic          86 k
 php-pdo              i386         5.3.28-2.w5           webtatic          66 k
 php-xml              i386         5.3.28-2.w5           webtatic         112 k

Proceed with the install, answer Y

Then do
signal-event post-upgrade
signal-event reboot

Test & see if working as required etc.
« Last Edit: January 21, 2014, 12:18:30 AM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline BlueLake

  • ***
  • 56
  • +0/-0
Re: php-postgres
« Reply #11 on: January 20, 2014, 07:41:38 PM »
Hi janet and thanks...

First up

when I started this my first action was to google anything and everything to accomplish the task...one google  stated very clearly that I needed php5-pgsql - so I wasn't misleading you as such. It seemed logical (to me at least) centos 8+ php5+ etc.. that I needed php5

anyway between yourself and Xavier Ansoult I think I have managed to do it. Which means pdo_pgsql.so and pgsql.so etc are now in the /etc/lib64/php/modules directory...there are other problems with php but I am not sure what they are yet...!

next

putty, what a great little piece of software that is. saves so much work, which brings me onto the next thing.

In a windows environment I would have copied the pgsql.dll from say a test client (windows xp/vista etc) with php apache pstgresql installed and copied the dll to say sbs2008.

Being that the pgsql.so is a linux version of a dll could I not have achieved the same result from a linux mint client with php 5.3 and apache / postgresql installed to sme server using putty..? or does the rpm install repo do other things. If nothing else I have certainly become a big fan of Putty.  :cool:



Offline michelandre

  • *
  • 261
  • +0/-0
Re: php-postgres
« Reply #12 on: February 23, 2015, 03:13:40 AM »
I installed PostgreSQL-9.4 on a SME-9 to work with Odoo-8 And it works

Have a look here: http://www.micronator.org/?page_id=1765

It is in French but you should be able to understand the commands.

Chapter IV is about installing PostgreSQL 9.4. At the end you have to give the 2 commands: signal-event post-upgrade and  signal-event reboot.

I also installed Python-2.7.8 in a virtualenv. It does'nt interfere with the SME Python.

Michel-André