Page 1 of 1

Getting PHP 5.3alpha installed

Posted: Thu Nov 13, 2008 2:12 pm
by alex.barylski
I just reformatted my Debian server and I'm setting everything up...when I went to install PHP5 I decided to Google wuickly and see what version Etch uses by default...apparently the stable is 5.2.X or something.

Ideally I want to get PHP 5.3 alpha up and running so I can play with some of it's features, mostly intl().

I haven't yet installed PHP yet using apt but I do have Apache up and running.

Would it be best to install the latest package and update the binaries/config files manually?

What will I have to do to get the latest PHP5 version runnin on my server? I assume download the source, untar, compile, ./configure or whatever? Once I have the binary compiled do I just copy over the existing one and merge the INI file updates? Is this the hard way hopefully? :P

I'd prefer something a little quicker as I don't feel like struggling with config files, etc...

Re: Getting PHP 5.3alpha installed

Posted: Thu Nov 13, 2008 7:45 pm
by alex.barylski
Didn't even occur to me to Google (Compile PHP -- as opposed to Install debian php5.3 or whatever I was searching) but I just did and found a few articles:

http://www.web-tech-india.com/articles/ ... /steps.php
http://ishouldbecoding.com/2008/03/08/c ... -and-linux
http://phpmelb.org/index.php?option=com ... icle&id=69

The last one is of most interest to me as the ./configure is the most verbose. Why?

I realize they are compiler switches and I can easily figure out which each one enables or disables (and take an educated guess with most) and I assume that has something to do with my error I'm currently getting after I run ./configure

Code: Select all

Configuring extensions
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
Because I don't specify any switches I assume ./configure assumes the default?

EDIT | When I installed libxml2-dev this solved the configur error and ./configure seems to setup fine. Now I'm nervous to run 'make'. :lol:

Also, when I ran:

Code: Select all

apt-get install libxml2
It seemed to install and yet when I ran ./configure again...it still choked with the same error. :banghead: :lol:

Do I need all those switches? Can't most of those extensions be loaded dynamically in php.ini??? Or are those switches saying compile the sources for each extension in binary form? I assumed it meant they were included into the php binary as a whole...which is probably wrong?

I assume once I get ./configure to succeed and make there after (if I can figure out that XML lib issue) make will install PHP binaries and it's files, etc? Does it update the Apache modules too? Does all this get done by hand?

Cheers,
Alex

Re: Getting PHP 5.3alpha installed

Posted: Fri Nov 14, 2008 7:21 am
by VladSun
You don't need to use all of the configure options - they have default values and you may change them depending on your needs. Sometimes you need to change some of the used options, especially when PATHs to libraries are required.

./make will compile the sources and executables/binaries can be found in the directory and subdirectories where the sources reside.

./make install will copy the executables/binaries to directories specified as "instalation path" with ./configure options.
Does all this get done by hand?
99% of the times - YES :)

Re: Getting PHP 5.3alpha installed

Posted: Fri Nov 14, 2008 4:50 pm
by alex.barylski
I printed the list of options for ./configure and hilited the required extensions/modules.

Apache is already installed via apt-get but I think I may uninstall it (purge?) and compile Apache from scratch as well with PHP and it's extensions as static objects. For a customized system this should make sense, correct?

Re: Getting PHP 5.3alpha installed

Posted: Sat Nov 15, 2008 3:57 am
by alex.barylski
Whoop whoop!!!

I finally got PHP 5.3Alpha installed and running...it would have been easier to have just built Apache and PHP from scratch...but because I insisted on keeping Apache I had to jump through some hoops before I finally figured it out...

If anything it was a valuable experience and taught me about 'dev' packages...PITA...I guess that is the Linux way...damn dependencies. :P

Cheers,
Alex

Re: Getting PHP 5.3alpha installed

Posted: Sat Nov 15, 2008 5:51 am
by VladSun
Congrats :)

I think you should try with Slackware just for a while (a day or two) ;)
Just install it on a VM (no window managers ofcourse ;) ) and try several things:
- Apache/PHP/MySQL and GD! installation;
- recompile the kernel with some patches (e.g. IMQ patch);
- download and compile some kernel modules you need;

Then back to distributions with packet managers.

I think it will be very useful for you.

Re: Getting PHP 5.3alpha installed

Posted: Sun Nov 16, 2008 11:15 am
by alex.barylski
That is essentially what I'm doing now but with Debian not Slackware...at least I think I am.

I've downloaded Apache and compiled it and next plan to compile Apache to use PHP as a static module as opposed to the DSO...

Although I do need all this done by tonight so I can begin continuing development of my project...

If I reformat and reinstall LAMP using apt-get can I manually upgrade just PHP by downloading the source, compiling 5.3 and installing it over top of 5.2.X or whatever exists by default with Debian??? Would I have to still update config files, etc?