Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is compiling PHP always a pain in the butt?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Is compiling PHP always a pain in the butt?

djvdorpdjvdorp Member
edited February 2012 in General

Decided to compile PHP and Nginx etc from source to get the latest bleeding edge version.
But PHP always seems to fail building because its dependencies are not met before building,
like libxml2 libjpeg and that kinda packages.
How do you guys do this?

Comments

  • The same way you are doing it.

    ./configure
    add missing packages until configure finishes with no errors
    make

    It's the downside of starting with a minimal system that doesn't have all the needed packages loaded.

    Thanked by 1djvdorp
  • How do you guys do this?

    apt-get install php

    Want to compile - install gentoo.

    Thanked by 1djvdorp
  • @breton said: Want to compile - install gentoo.

    Ah okay, thanks. is there any reason to choose gentoo then? how about arch?
    that is also for compiling right?
    so debian -> use apt-get install
    gentoo/arch -> compile from source?

  • fanfan Veteran

    apt-get install the missing packages mentioned, or install the latest version (perhaps) from dotdeb

    Thanked by 1djvdorp
  • yomeroyomero Member
    edited February 2012

    Ahm, ok, you want to compile...

    Before that, take a look at the dotdeb.org site if you use a debian one

    Second, if you have dependency issues, try installing one by one and doing configure each time. For example, if I need libxml2, in debian I do apt-get install libxml2-dev as @cleonard says. Surely your distro has these "-dev" packages somewhere.

    Thanked by 1djvdorp
  • MrDOSMrDOS Member
    edited February 2012

    Generally, dependencies don't change too much, especially between minor versions (x.y.z, where z is the number changing). Enable a source repository in /etc/apt/sources.list, then apt-get update and apt-get build-dep php5. That should get most of the dependencies, if not all.

    Thanked by 1djvdorp
  • you think php is bad? try perl.

  • manually adding dependencies before apt/yum etc was popular was an experience!

  • You think compiling PHP on Debian is hard, wait till you see OS X, even with Homebrew its a pain.

    @kbar said: you think php is bad? try perl.

    Perl modules are a pain in the ass to install, and they ask so many stupid questions.

  • OS X is shit in general everything is deprecated

  • Compiling PHP from source is not hard at all. Here is a simple tutorial I made for CentOS (PHP-FPM) V. 5.3.10.

    http://derekharget.com/2012/02/35/centos-install-php-5-3-10-php-fpm-from-source

    I have other tutorials on how to get APC installed and where to locate php.ini.

    Thanked by 1djvdorp
  • @kbar said: OS X is shit in general everything is deprecated

    Huh? Compared to some Linux Distro's, OS X actually has up to date libraries and softwares, but Homebrew fills in the gaps.

    Thanked by 1djvdorp
  • Steve81Steve81 Member
    edited February 2012

    @Daniel said: You think compiling PHP on Debian is hard, wait till you see OS X, even with Homebrew its a pain.

    With macports you are required only to do:

    port install php
    
  • @Steve81 And now you've got two copies of PHP installed, and have to now setup the system to use that one.

    Homebrew uses /usr/local

    Thanked by 1djvdorp
  • Steve81Steve81 Member
    edited February 2012

    @Daniel said: @Steve81 And now you've got two copies of PHP installed, and have to now setup the system to use that one.

    You mean that we have the osx copy and the macport copy?

    True, but it's the same with homebrew; homebrew install in /usr/local, as you wrote, but osx version of php is in /usr/bin.

    Personally I prefer the macports solution to install in /opt/local (for example that's avoid conflicts with manual installed sources).

    Thanked by 1djvdorp
  • MrAndroidMrAndroid Member
    edited February 2012

    @Steve81 said: True, but it's the same with homebrew; homebrew install in /usr/local, as you wrote, but osx version of php is in /usr/bin.

    /usr/local was actually left free by Apple for things like homebrew to use. It also requires the directory to be complacent with POSIX.

    MacPorts is slow though, HomeBrew is so much quicker.

Sign In or Register to comment.