Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Jun 05, 2011 3:27 pm 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
Hi,

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.


Top
   
 Post subject:
PostPosted: Sun Jun 05, 2011 4:46 pm 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
Ah yes, here is the way I installed it all (by the way):

https://github.com/vladgh/VladGh.com-LEMP


Top
   
 Post subject:
PostPosted: Sun Jun 05, 2011 4:48 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Why did you compile php?

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

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sun Jun 05, 2011 5:20 pm 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
Thanks for your answer!

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 ;) I've spent the last 10 years on windows and know it inside out, but this is completely different. Reminds me a bit of working on a Commodore Pet years ago ;)


Top
   
 Post subject:
PostPosted: Sun Jun 05, 2011 5:30 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Yes the command is on one line and should be in the same directory you ran phpize in

(Also if you can you should consider switching to your distros php version instead of compiling your own)

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Mon Jun 06, 2011 5:22 am 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
The problem is though, I can install postresql, but in order to get it to work with php I am reading that I need to recompile php.

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 ;)


Top
   
 Post subject:
PostPosted: Mon Jun 06, 2011 5:35 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
If you compiled php then no you don't need to recompile it, you can compile a dynamic extension and install that which is what I gave you commands to do.

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.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Mon Jun 06, 2011 5:42 am 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
I did compile it, so excellent :) Thanks very much for your help.


Top
   
 Post subject:
PostPosted: Mon Jun 06, 2011 5:54 am 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
By the way, I used this guide: http://vladgh.com/blog/install-nginx-an ... on=node/18

(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.


Top
   
 Post subject:
PostPosted: Mon Jun 06, 2011 7:49 am 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
Ack! I have hit a problem :(

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?


Top
   
 Post subject:
PostPosted: Mon Jun 06, 2011 9:16 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
You probably need to edit your php.ini file with extension=<name of the postgresql extension>.so

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Mon Jun 06, 2011 10:04 am 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
I recompiled it ok, but a lot of errors to do with the postgresql version supplied by enterprisedb.com, otherwise ok.

I'm waiting to hear from them before just going with 9.0 from repository I think.

I will update this in due course.


Top
   
 Post subject:
PostPosted: Mon Jun 06, 2011 10:26 am 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
Example:

Code:
/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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group