PHP and the build process (/.configure, make and install): orientation, please
Asked Answered
P

2

6

I'm a newbie and after I've successfully learnt enough to build my simple but useful web services, I managed to put myself in a position where I need to configure my own PHP build.

The problem is I don't really know what build means --never built anything either.

My broad question is: Any good step by step tutorial that doesn't just say "must have dependencies"?

My specific question is: For instance, one that shows how to build PHP with odbc, then rebuild (configure.nice and make nice?) with imap in addition.

If someone finds a PHP bundle that comes with odbc, great; with odbc & imap, better. But I'm really looking for someone to show me how to fish. Please.

Thnx. A.

Parts answered 30/11, 2010 at 21:54 Comment(2)
Better suited for the superuser.com section.Correlative
Thanks, will keep in mind for the next time.Parts
A
10

Gazler is correct, for a simple setup, you can just configure Ubuntu through the repositories via apt-get. For RHEL-based systems - yum would be the equivalent. However, if you are wanting to know more of how to compile from scratch (which would give you more control over installation), then you can do so.

Basics of compiling an application:

  1. Download source from website (such as PHP, www.php.net)
  2. untar the source (tar -xzvf source.tar.gz)
  3. cd source
  4. Configure the source (./configure [install-option-flags])
  5. Compile source (make)
  6. Test Install (doesn't actually install) - make test
  7. Install the software (make install)

Step 4 is a very broad step. You will need to figure out what options you want to configure - see PHP Core Configuration Options.

Requirements for installing PHP will differ between environments, so that's too broad to cover in one answer, however, you will at least need a c-compiler to compile the source. Usually gcc is my choice, and is usually installed already. On Ubuntu (Debian-based) use apt-get install build-essential or search and install via yum on RHEL-based systems, I believe it would be something like yum install gcc.

You will probably run into dependencies issues as you compile, as I said its a very broad step, however, once you figure out the requirements that you need, you should be good to go, so long as you document your steps for your environment.

Again, the easiest way to go is to install via your software repository (apt-get, yum, emerge, pacman, etc), but these don't give you as much leverage on controlling your environment installation, whereas building from source gives you all the configuration control that you'd need.

Aminta answered 30/11, 2010 at 23:42 Comment(0)
S
1

You haven't mentioned what distro you are on, On ubuntu you can do:

sudo apt-get install lamp-server^ php5-imap php5-odbc

That should be enough to get you started and configured.

Sylvestersylvia answered 30/11, 2010 at 21:58 Comment(1)
Sorry about that, that would be Mac OSxParts

© 2022 - 2024 — McMap. All rights reserved.