Solved

How to compile and install PHP 5.2.6 on Xserve running Mac OS X Server 10.5.3

Posted on 2008-06-11
11
2,287 Views
Last Modified: 2013-12-13
I need to update the version of PHP that is running on our xserver.  I am told that 5.2.6 must be installed to meet a requirement for PCI compliance.  Apple has 5.2.4 listed on their site as a download but not 5.2.6.  I have downloaded 5.2.6 from php.net and now do not know how to install.  Do I need to download anything else and how do I compile and install?
0
Comment
Question by:tammyf
11 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 21770416
If there is no special need for 5.2.6 (application used tdoes not work because of a bug in php) stick with 5.2.4.
To compile you need a lot of additional development libraries and if you are not realy familiar with compiling programs it will take you days to get your installation to work as you expect it.
0
 
LVL 7

Expert Comment

by:kanlue
ID: 21770474
if you like, you can try the following steps:
---------
sudo mv /usr/local/php5 ~/Desktop/php5.old
curl -O http://us3.php.net/distributions/php-5.2.6.tar.gz 
tar -xzf php-5.2.6.tar.gz
sudo mv php5 /usr/local/
sudo ln -sf /usr/local/php5/entropy-php.conf /etc/apache2/other/+entropy-php.conf
sudo apachectl restart
----------

and you can find more info here:
http://www.entropy.ch/software/macosx/php/

hope it helps.
0
 

Author Comment

by:tammyf
ID: 21770986
We can't stick with 5.2.4 because it does not meet PCI compliance requirements.  We are being forced to upgrade so we can keep accepting credit cards.
0
 
LVL 1

Expert Comment

by:m-tron
ID: 21831090
In terminal type (apachectl -V) and post the output
0
 

Author Comment

by:tammyf
ID: 21832261
Here is the output from apachectl -V attached.
picture-server.png
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 1

Expert Comment

by:m-tron
ID: 21832554
Install xcode if not already Installed.

Find the header files for your version of MySQL.
This example assumes they are located @ /usr/local/mysql/
You can find your version by typing mysql -V in the terminal.

open terminal and enter the following...

su

cp /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.old

mkdir /source

cd /source

curl -O http://www.ijg.org/files/jpegsrc.v6b.tar.gz

tar -xvf jpegsrc.v6b.tar.gz

curl -o "php-5.2.6.tar.bz2" -L http://us2.php.net/get/php-5.2.6.tar.bz2/from/us.php.net/mirror

tar -xvjf php-5.2.6.tar.bz2

cd /source/jpeg-6b

cp /usr/share/libtool/config.sub .

cp /usr/share/libtool/config.guess .

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os  -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os  -pipe" CXXFLAGS="-arch x86_64 -g -Os  -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --enable-shared

make

mkdir -p /usr/local/include

mkdir -p /usr/local/bin

mkdir -p /usr/local/lib

mkdir -p /usr/local/man/man1

make install

cd /source/php-5.2.6/ext/gd

phpize

cd ../..

MACOSX_DEPLOYMENT_TARGET=10.5 \
CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" \
CCFLAGS="-arch x86_64 -g -Os -pipe" \
CXXFLAGS="-arch x86_64 -g -Os -pipe" \
LDFLAGS="-arch x86_64 -bind_at_load" \
./configure --prefix=/usr \
  --mandir=/usr/share/man \
  --infodir=/usr/share/info \
  --sysconfdir=/etc \
  --with-zlib \
  --with-zlib-dir=/usr/ \
  --with-jpeg-dir=/usr/local/lib \
  --with-png-dir=/usr/X11R6 \
  --with-freetype-dir=/usr/X11R6 \
  --with-xpm-dir=/usr/X11R6 \
  --with-openssl \
  --with-curl \
  --enable-exif \
  --enable-ftp \
  --enable-mbstring \
  --enable-mbregex \
  --enable-sockets \
  --with-mysql=/usr/local/mysql \
  --with-mysqli=/usr/local/mysql/bin/mysql_config \
  --with-apxs2=/usr/sbin/apxs \
  --without-iconv

make

make install

cp /etc/php.ini.default /usr/lib/php.ini
__________________
edit /usr/lib/php.ini
add -> extension=gd.so
disable -> extension_dir = "./"
save and exit
___________________
edit /etc/apache2/httpd.conf
search for libphp5.so
make sure it is enabled
if you can't find it add the line -> LoadModule php5_module        libexec/apache2/libphp5.so
save and exit
___________________
apachectl -k graceful

Load a file with phpinfo(); and see if it worked.

This worked for me on a fresh install of Leopard Server updated to 10.5.3
0
 

Author Comment

by:tammyf
ID: 21832598
Thanks for all of that however I don't know how to load a file with phpinfo().  However I am willing to try the commands above and then just reinstall the operating system if something goes wrong.
0
 
LVL 1

Expert Comment

by:m-tron
ID: 21832621
forgot to mention to install the X11 SDK also included in the xcode dmg file
0
 
LVL 1

Accepted Solution

by:
m-tron earned 500 total points
ID: 21832649
There should be a file called info.php in the directory /Library/WebServer/Documents
open it with textedit and remove the // before phpinfo(); and save.
in your browser navigate to http://localhost/info.php
you should get a page telling you information about php.

Hope this helps.
0
 

Author Comment

by:tammyf
ID: 21832667
I will try it this weekend when I can take the server down without causing an uproar.  I will post my results.  Thanks!
0
 

Author Closing Comment

by:tammyf
ID: 31466433
This was a thorough explanation.  Apple came out with the update so I did not have to use it however.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now