Installing multiple php versions plus extensions on freebsd

Posted by jgtumusiime on Server Fault See other posts from Server Fault or by jgtumusiime
Published on 2012-11-20T18:28:02Z Indexed on 2012/11/21 17:02 UTC
Read the original article Hit count: 627

Filed under:
|
|

I'm a currently learning how to work with freebsd. Lately I have been trying to run multiple php versions along with their respective packages. However, I seem to be running into issues while making installations.

The default location for my php installation is /usr/local/etc/, however I want to be able to install php5.2, php5.3 and php5.4 in /usr/local/etc/php52, /usr/local/etc/php53 and /usr/local/etc/php54 respectively.

Using ports I simply achieved this by doing cd /usr/ports/lang/php5x && make PREFIX="/usr/local/etc/php5x" install clean.

The problem now is: How do I do the same for extensions of all my PHP versions? When I try installing php-extensions like so: cd /usr/ports/lang/php5x-extension && make PREFIX="/usr/local/etc/php5x/lib/php" install clean, I get this error

...
===>  PHPizing for php53-bcmath-5.3.17
env: /usr/local/bin/phpize: No such file or directory
*** Error code 127

Stop in /usr/ports/math/php53-bcmath.
*** Error code 1

Stop in /usr/ports/lang/php53-extensions.

My PHPize is located in /usr/local/etc/php5x/bin/phpize So how do I get make or whatever to look for phpize in the right path? Is there a cleaner, may be simpler way of maintaining multiple php installations? I need to achieve this because of compatibility issues from some legacy code that runs on 5.2 and breaks on 5.3.

Thank you.

=================

So I successfully installed an configured freebsd jail and I would like to install software within my jail but I cannot connect to the network. Here is my rc.conf

jail_enable="YES"   # Set to NO to disable starting of any jails
jail_list="mambo2"     # Space separated list of names of jails

jail_mambo2_rootdir="/usr/jails/j01"     # jail's root directory
jail_mambo2_hostname="mambo2.ug"  # jail's hostname
jail_mambo2_ip="192.168.100.174"           # jail's IP address
jail_mambo2_devfs_enable="YES"          # mount devfs in the jail
jail_mambo2_devfs_ruleset="mambo2_ruleset" # devfs ruleset to apply to jail

here is my jail ifconfig output

mambo2# ifconfig
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 00:c1:28:00:48:db
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
mambo2#

I created a /etc/resolv.conf for nameservers

mambo2# cat /etc/resolv.conf 
nameserver  192.168.100.251
nameserver  8.8.8.8

mambo2# 

Here is a list of jails running

[root@mambo /usr/home/jtumusiime]# jls
JID  IP Address      Hostname                      Path
5  192.168.100.174 mambo2.ug                     /usr/jails/j01

my host has 4 ip addresses, 3 public and one private: 192.168.100.173

I tried creating a jail using ezjail and this does not work out.

[root@mambo /usr/home/jtumusiime]# ezjail-admin update -p -i
Error: Cannot find your copy of the FreeBSD source tree in .
  Consider using 'ezjail-admin install' to create the base jail from an ftp server.
[root@mambo /usr/home/jtumusiime]# 

I have an updated copy of freebsd 7.1 source in /usr/src/ and I did #make buildworld while building the first jail mambo2

Here is an excerpt of ouput of ezjail-admin install

...
221 Goodbye.
Trying 193.162.146.4...
Connected to ftp.freebsd.org.
220 ftp.beastie.tdk.net FTP server (Version 6.00LS) ready.
331 Guest login ok, send your email address as password.
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Type set to I.
550 pub/FreeBSD-Archive/old-releases/i386/7.1-RELEASE/base: No such file or directory.
221 Goodbye.

Could not fetch base from ftp.freebsd.org.
  Maybe your release (7.1-RELEASE) is specified incorrectly or the host ftp.freebsd.org     does not provide that release build.
  Use the -r option to specify an existing release or the -h option to specify an     alternative ftp server.
Querying your ftp-server... The ftp server you specified (ftp.freebsd.org) seems to         provide the following builds:
Trying 193.162.146.4...
total 10
drwxrwxr-x  13 1006  1006   512 Feb 20  2011 8.2-RELEASE
drwxrwxr-x  13 1006  1006   512 Apr 10  2012 8.3-RELEASE
lrwxr-xr-x   1 1006  1006    16 Jan  7  2012 9.0-RELEASE -> i386/9.0-RELEASE
drwxrwxr-x   7 1006  1006  1024 Feb 19  2012 ISO-IMAGES
-rw-rw-r--   1 1006  1006   637 Nov 23  2005 README.TXT
drwxrwxr-x   5 1006  1006   512 Nov  2 02:59 i386

I do not want to upgrade my freebsd installation. I have googled around; but all on vail

© Server Fault or respective owner

Related posts about php

Related posts about freebsd