• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Installing/Compiling pgsql for php - mediatemple (dv)

F

flames4zero

Guest
All I want to do is add the pgsql.so extension. I'm told I need to recompile php with configure --pgsql. Are there any kind souls out there who can explain how to do this via Plesk? Has anyone done this?

thanks.

Here are my server details:

Plesk version psa v8.2.0_build82070706.15 os_CentOS 4.2
Operating system Linux 2.6.9-023stab040.1-enterprise

PHP Version 5.1.4

'./configure' '--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux' '--program-prefix=' '--prefix=/opt/php51' '--exec-prefix=/opt/php51' '--bindir=/opt/php51/bin' '--sbindir=/opt/php51/sbin' '--sysconfdir=/opt/php51/etc' '--datadir=/opt/php51/share' '--includedir=/opt/php51/include' '--libdir=/opt/php51/lib' '--libexecdir=/opt/php51/libexec' '--localstatedir=/var' '--sharedstatedir=/opt/php51/com' '--mandir=/opt/php51/share/man' '--infodir=/opt/php51/share/info' '--disable-xmlreader' '--prefix=/opt/php51' '--datadir=/opt/php51/share/php5' '--mandir=/opt/php51/share/man' '--bindir=/opt/php51/bin' '--with-libdir=lib' '--includedir=/opt/php51/include' '--sysconfdir=/opt/php51/etc/php5/fastcgi' '--with-config-file-path=/opt/php51/etc/php5/fastcgi' '--with-config-file-scan-dir=/opt/php51/etc/php5/conf.d' '--with-exec-dir=/opt/php51/lib/php5/bin' '--enable-soap' '--enable-magic-quotes' '--enable-libxml' '--enable-session' '--with-pcre-regex' '--enable-xml' '--enable-simplexml' '--enable-spl' '--enable-safe-mode' '--enable-sigchild' '--disable-debug' '--enable-memory-limit' '--enable-inline-optimization' '--enable-zend-multibyte' '--disable-rpath' '--with-kerberos=/usr/kerberos' '--enable-force-cgi-redirect' '--disable-discard-path' '--enable-fastcgi' '--bindir=/opt/php51/cgi-bin' '--disable-cli' '--disable-ipv6' '--disable-dom' '--disable-pdo' '--disable-tokenizer' '--disable-xmlreader' '--disable-xmlwriter' '--disable-posix' '--without-iconv' '--without-sqlite' '--enable-libxml'

Server API CGI/FastCGI
 
Okay, so I downloaded php5 and configured it:

creating cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... //bin/sed
checking host system type... i686-redhat-linux-gnu
checking target system type... i386-redhat-linux-gnu
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

Now I have to install gcc/cc, how do I do this?
 
I got lost pretty quickly here. I think I need to install yum and/or up2date as neither seem to be installed.

Any advice?
 
I got pretty far, but I'm stuck trying to build php, failing with:

configure: error: Cannot find libpq.so. Please specify correct PostgreSQL installation path
 
So I was able to get around this by installing some packages, postgres, postrges-devel, gcc.

I can now build! However, all it did was generated a php5 executable. I don't see any files generated in the directories I specified in the config.

If I try running it, it references directories from an old php5 build (that was already on the system):

[root@weaktight php-5.2.3]# /var/www/vhosts/example.com/bin/php5
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/php51/lib/php5/extensions/pgsql.so' - /opt/php51/lib/php5/extensions/pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
<br />
<b>Warning</b>: PHP Startup: Unable to load dynamic library '/opt/php51/lib/php5/extensions/pgsql.so' - /opt/php51/lib/php5/extensions/pgsql.so: cannot open shared object file: No such file or directory in <b>Unknown</b> on line <b>0</b><br />
PHP Warning: Module 'gd' already loaded in Unknown on line 0
<br />
<b>Warning</b>: Module 'gd' already loaded in <b>Unknown</b> on line <b>0</b><br />
 
Silly me, forgot to make.
# make
# make text
# make install
Installing PHP SAPI module: cgi
Installing PHP CGI binary: /usr/local/php5/cgi-bin/
cp: cannot create regular file `/usr/local/php5/cgi-bin//usr/#INST@31996#': No such file or directory
make: *** [install-sapi] Error 1

Now what?
 
It's /centos/4/.

I'm trying to build PHP 5.2.3; I downloaded the source direct from php.net.

I installed php-pgsql via # apt-get install php-pgsql. I'm not sure how I get the version number?
 
I'm trying to build php... so there is nothing to run yet.
 
ouch, ok dont ever use apt-get again, thats for debian. You're just getting yourself into more trouble with that.

On centos, you'd use yum, which supports php-pgsql natively (yum install php-pgsql). If you want that in PHP 5.1, you'd use the centosplus channel, and for 5.2.x Ive got php 5.2.x in my archive at www.atomicrocketturtle.com
 
Sorry, I'm new to this linux deal. So I'm not sure I follow the details.

I have been installing things via apt which I installed.

So I've run # apt-get php-pgsql. I'll do an # apt-get install yum

I assume I have everything setup, I'm just failing on # make install ; for the php-5-2-3 build.

Are you suggesting I abort trying to build it and install php5.2.3 via yum? This will work with the php-pgsql installed?

I see:
http://www.atomicorp.com/channels/atomic/centos/4/i386/RPMS/php-5.2.3-2.el4.art.i386.rpm
http://www.atomicorp.com/channels/atomic/centos/4/i386/RPMS/php-pgsql-5.2.3-2.el4.art.i386.rpm
(I'm not sure what the -1 vs -2 is)

So if I install these, I'll have a built version of php5.2.3 with pgsql ready to go? Then I can fastcgi to my content... is this correct?
 
If you want that in PHP 5.1, you'd use the centosplus channel

I'm not sure what you mean by this, can you explain? php51 is already installed by default, so this sounds like the easiest solution.


uh oh, I hope I didn't mess anything up with apt... it seemed to work pretty well :/
 
*shudder* I have no idea what that did.

Yum is built in, its the standard for Red Hat, Fedora and Centos. You should never have to resort to apt for anything on that platform.
 
Okay, well yum wasn't installed, I had to install it via apt-get; at least that was the way I did it, not that I know what I'm doing.

Can you explain what you mean by "If you want that in PHP 5.1, you'd use the centosplus channel"? I found you talking about this in another thread in this forum, but it was left unanswered as well :)
 
So, I assume the next step is to replace everything that's installed or update it via atomic. How do I do this?
 
This totally worked... just like that I'm up to php 5.2.3

Thanks!
 
Everything seems happy, but I've noticed this warning in phpmyadmin:

Code:
Your PHP MySQL library version 4.1.22 differs from your MySQL server version 5.0.27. This may cause unpredictable behavior.

Anyone know how to resolve this?
 
Back
Top