Compiling on UNIX

Now that you've got all the necessary tools together, you've downloaded the PHP source tarball, and you've identified all the necessary ./configure switches, it's time to actually compile PHP.

Assuming that you've downloaded php-5.1.0.tar.gz to your home directory, you'll enter the following series of commands to unpack the tarball and switch to the PHP source directory:

[/home/sarag]$ tar -zxf php-5.1.0.tar.gz [/home/sarag]$ cd php-5.1.0

If you're using a tool other than GNU tar, you might need to use a slightly different command:

[/home/sarag]$ gzip -d php-5.1.0.tar.gz | tar -xf -

Now, issue the ./configure command with the required switches and any other options you want enabled or disabled:

[/home/sarag/php-5.1.0]$ ./configure enable-debug enable-maintainer-zts disable-cgi enable-cli disable-pear disable-xml disable-sqlite without-mysql enable-embed

After a lengthy process, during which dozens of lines of informational text will scroll up your screen, you'll be ready to start the compilation process:

[/home/sarag]$ make all install

At this point, get up and grab a cup of coffee. Compile times can range from anywhere between a couple minutes on a high-end powerhouse system to half an hour on an old overloaded 486. When the build process has finished, you'll have a functional build of PHP with all the right configuration ready for use in development.

Категории