I've forgotten how I compiled PHP & now I need to add Po
Months ago I spent about 175 hours setting up my server with Nxinx, Mysql, PHP, sudsomething APC and got it all working with phpmyadmin etc, plus threw in a helping of Teamspeak 3 server just to really set my teeth on edge.
Well it's all worked great, but now I need Postgresql for a project, and I am going to have to compile PHP again.
The trouble is, I don't want to lose whatever way I have PHP set up currently, I just want to keep it all and add in postgre. Is there any way to do this please? I didn't write down all the added arguments I gave the last php compile, I didn't realise I would need them again. Is there any way to tell it just to add postgre and keep the rest the same? Or so I have to start from scratch and install nginx, php, etc?
Thanks for you help,
TT
P.S. I seem to have forgotten all that I learned from when I made the server build the first time.
12 Replies
Anyway, you'll want to install postgresql and the development libraries, download the php source for your php version, then pop into the pgsql extension directory (off hand probably something like ext/pgsql) and run the phpize command, then ./configure && make && make test && make install
After the phpize, did you mean type this as one line? ("./configure && make && make test && make install" and what directory should I be in, the PHP one or Postgre?
Sorry if this sounds stupid, would you believe that at one time I wrote computer games, a Z80 emulator, simple disk OS etc, but all the intricacies of this make my head spin - my trouble is remembering them all for all the different packages
(Also if you can you should consider switching to your distros php version instead of compiling your own)
Is that not correct?
Using your method above, will I lose any of my earlier compile options on PHP? The reason it was originally compiled was to add stuff like suhosin(?) APC and some other bits.
I would hate for them to fall off
If you installed php, then it's an apt-get/yum/whatever your distro's installer is away.
The commands I gave only compile a dynamic extension that's it so nothing will be lost.
(you might need to create a dummy login to read, just put a junk email address and you will see it without having to go through the whole registration process - it's quick, honest)
The reason I used that at the time was because I wanted a working nginx installation with those other options and the feedback on his method was very good, some of it from some well known & respected commentators. So I thought I would go with his method as it got me what I wanted in my LEMP stack. It's actually worked really well and I am happy with it.
The trouble came when I then needed to add something and because I didn;t understand properly the process I followed, I was stuck. I didn't realise that making something didn't mean a full recompile. In the old days (when I used make to compile assembly language into machine code) it meant you were doing the whole thing again.
So, I now understand (from your help explanation) that it seems to only recompile the bit you are working on - which is definitely more intuitive.
I just thought I would add that so you knew where I was coming from as it was maybe a bit confusing
Thanks again for your help - it is much appreciated and has saved me valuable time
EDIT: Oh and also, another reason for compiling and not using my distro builds is that I need some of the newer features. For example, the postgresql version with distro is 8.4. Version 9.0 introduces a feature that is absolutely key to what I am doing - replication with slave read servers allowing a hot swap.
I am using a installed (.bin executable) version of postgresql that has added monitoring tools from enterprisedb.com
After installing, my phpinfo shows no postgre modules. Now obviously this is a question for their support, but could anyone here comment on the generalities of what I am doing. i.e. is it generally not possible to install from bin if I am hoping to then integrate with PHP, or is it just a matter of having the source and phpizing it?
I'm waiting to hear from them before just going with 9.0 from repository I think.
I will update this in due course.
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /root/lemp/php-5.3.5/sapi/cli/php)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /root/lemp/php-5.3.5/sapi/cli/php)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /root/lemp/php-5.3.5/sapi/cli/php)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /root/lemp/php-5.3.5/sapi/cli/php)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /root/lemp/php-5.3.5/sapi/cli/php)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /root/lemp/php-5.3.5/sapi/cli/php)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /root/lemp/php-5.3.5/sapi/cli/php)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /usr/lib/libexslt.so.0)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /usr/lib/libexslt.so.0)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxml2.so.2: no version information available (required by /usr/lib/libexslt.so.0)
/root/lemp/php-5.3.5/sapi/cli/php: /opt/PostgresPlus/9.0SS/lib/libxslt.so.1: no version information available (required by /usr/lib/libexslt.so.0)
libxml2 is installed and the latest version by the way.