SlideShare a Scribd company logo
1 of 12
Download to read offline
Updating PHP
                     on
            Mac OS X Server 10.4.x



   1. - Introduction

   2. - What is installed as part of OS X Server

   3. - Requirements

   4. - Getting and installing the latest version of PHP4

   5. - Adding/removing features to/from PHP

   6. - Getting and installing the latest version of PHP5

   7. - Caveats - READ this chapter!




----------------------------------------------------------------
DISCLAIMER: The author(s) claim(s) no responsibility for any
damage that may occur from the use of any information found here
or found on links followed from this document. The author(s)
will take credit for the good stuff though.

All items and/or companies mentioned on this and other pages are
or may be trademarks, registered trademarks, or service marks of
the respective companies or individuals.
----------------------------------------------------------------
1. - Introduction
The purpose of this document is to provide instructions on how
to update the version of PHP included with OS X 10.4.x Tiger
Server. DO NOT USE this document to update PHP on 10.5.x Leopard
Server. An separate tutorial is available.

It will guide you through updating to the latest version of PHP4
without breaking Server Admin functionality. Furthermore you
will be shown how to update to the latest version of PHP5, while
retaining most of Server Admin's functionality.

Although the Apple included version of PHP4 is suitable for most
users, there are situations where one might need to update. A
common reason is to include support for the GD2 libraries.

This document will require you to use the command line. If you
do not feel comfortable with using the command line, you should
look for a ready made installer package.

Why should I use the command line if there are ready made
installer packages available? Short answer: Greater flexibility.
Long answer: The packages available, reflect the creators' views
on what should or shouldn't be included in the package. By
understanding how to install things yourself, you can choose
what to include in your PHP build.

This document is written for Mac OS X 10.4.x. However, it should
apply to 10.3.x as well. Be aware though that I have not done
any particular testing of this procedure on 10.3.x.

DISCLAIMER: Whatever you do based on this document, you do it at
your own risk! Just in case you haven't understood: Whatever you
do based on this document, you do it at your own risk!

This tutorial has been tested on a standard Mac OS X 10.4.x
Server. If you have already tinkered with your system, be aware
that things might differ. It is impossible for me to foresee all
changes that one might have applied to a server.

This tutorial contains step-by-step instructions for the
terminal. Although you could just type them in line by line, it
is recommended you have a basic understanding of the terminal.
2. - What is installed as part of OS X Server

In order to better understand OS X 10.4.x the process it is
useful to have a basic knowledge of the basic installation.

As of 10.4.8 and the latest security updates, Apple includes
PHP 4.4.4 with its server operating system. The configuration
used is as follows:

./configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --disable-dependency-tracking --
with-apxs --with-ldap=/usr --with-kerberos=/usr --
enable-cli --with-zlib-dir=/usr --enable-trans-sid --
with-xml --enable-exif --enable-ftp --enable-mbstring --
enable-mbregex --enable-dbx --enable-sockets --with-
iodbc=/usr --with-curl=/usr --with-config-file-path=/
private/etc --sysconfdir=/private/etc --with-mysql=/usr
--with-mysql-sock=/var/mysql/mysql.sock --without-pear

Looks scary? Don't worry, it will become clearer later on. This
line basically tells PHP what modules to install and what to
omit. A sample of options can be found here:
http://ch2.php.net/manual/en/configure.php
For those who can't wait and know what they do: to configure a
freshly downloaded PHP4 version to behave exactly as Apple
intended it to, just use above configuration command.
3. - Requirements

Before you get started, you need to make sure some basic
requirements are met:

- You have made a backup of your system.
- You have the latest version of Apple's Developer Tools
  (Xcode 2.4 or higher) installed.
  Dev Tools are available on your Server DVD and as a free
  download from Apple's Developer Connection.
- X11 SDK is installed (available on your OS X Developer Tools
  Disc or Image. This is different from the X11 client that
  comes with OS X.)
- You do have a backup
- You are running 10.4.x
- You have not manually updated anything related to PHP
  or Apache so far (if you have, you must know how to adapt
  these instructions to the changes you made).
- You have a PPC processor

- Not a requirement, but it is recommended you subscribe to our
  newsletter(s) or follow us on Twitter to be informed when
  updated versions of this tutorial become available:
  http://osx.topicdesk.com/newsletter/
  http://twitter.com/topicdesk/
4. - Getting and installing the latest version of PHP4

This chapter will guide you through replacing your current
version of PHP4 with the latest version available. It will not
add any functionality compared to the Apple installed version.
It will only give you the peace of mind to have the latest
version with the most recent security fixes. If you need extra
functionality, wait for the following chapters.

So let's get going:
Make sure you are logged in as root.

Get and install the latest version of PHP by issuing the
following commands (in oblique type). Issue them one after the
other making sure you do not miss any dots or slashes. Also note
that the download URL given will change in the future. In that
case just replace the URL in this document with the current one.
The URL used at the time this document was written refers to PHP
4.4.9. If you want to install a different version, adjust
accordingly. Lines wrapping without line spacing are a single
command.

gcc_select 3.3
(for PPC. Use "gcc_select 4.0" for Intel)

mkdir -p /SourceCache

cd /SourceCache

curl -O http://us3.php.net/distributions/
php-4.4.9.tar.gz

tar xzpf php-4.4.9.tar.gz

cd /SourceCache/php-4.4.9

sh

CFLAGS=-DBIND_8_COMPAT

export CFLAGS
(The following is one long line starting with './configure' and
ending with 'pear')
./configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --disable-dependency-tracking --
with-apxs --with-ldap=/usr --with-kerberos=/usr --
enable-cli --with-zlib-dir=/usr --with-xml --enable-exif
--enable-ftp --enable-mbstring --enable-mbregex --
enable-dbx --enable-sockets --with-iodbc=/usr --with-
curl=/usr --with-config-file-path=/private/etc --
sysconfdir=/private/etc --with-mysql=/usr --with-mysql-
sock=/var/mysql/mysql.sock --without-pear
(The above is one long line starting with './configure' and
ending with 'pear')

make

(Up to this point, you have only built PHP4. Your current
version has not been replaced. The next command will take care
of this).

make install

sudo apachectl graceful restart

exit

You should now be all set and have an "Apple compliant" version
of PHP4. Server Admin will still work as before.

/usr/bin/php -v will tell you the version.
/usr/bin/php -i will give you more info.

A more comfortable way of seeing the details of your PHP
configuration can be achieved through a special .php file.
Create a file called info.php with the following contents:
<?php
phpinfo();
?>
When done, place it in an accessible directory of your web-
server and call it through your browser. Detailed version and
configuration information will be displayed.
5. - Adding/removing features to/from PHP

Besides simply replacing PHP with the latest version, one can at
the same time choose additional options.

The basic procedure is the same as outlined in chapter 4. The
main difference is the addition/removal of configuration option.
A configuration option is what follows the ./configure command.
For example --with-config-file-path=/private/etc will tell
PHP4 to look for its configuration file inside "--with-config-
file-path=/private/etc".

Some options come as part of the PHP distribution and need only
to be added/removed. Others like "--with-gd" for example rely
on external components to be installed on your system. Simply
adding the option to ./configure will not be enough. In this
particular case you would tell PHP to add support for the GD
Graphics Library which you would need to install first. A
separate tutorial on installing the GD Graphics Library is
available on http://osx.topicdesk.com/.

Let's take this as an example then. Once you have installed GD
(following the other tutorial), you would repeat chapter 4 with
one notable exception: The ./configure statement needs to be
changed. Everything else is exactly the same.

(The following is one long line starting with './configure' and
ending with 'gd')
./configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --disable-dependency-tracking --
with-apxs --with-ldap=/usr --with-kerberos=/usr --
enable-cli --with-zlib-dir=/usr --with-xml --enable-exif
--enable-ftp --enable-mbstring --enable-mbregex --
enable-dbx --enable-sockets --with-iodbc=/usr --with-
curl=/usr --with-config-file-path=/private/etc --
sysconfdir=/private/etc --with-mysql=/usr --with-mysql-
sock=/var/mysql/mysql.sock --without-pear --with-jpeg-
dir=/usr/local --with-png-dir=/usr/local --with-
freetype-dir=/usr/X11R6 --with-gd=/usr/local
(The above is one long line starting with './configure' and
ending with 'gd')
If you look at above ./configure statement we have added "--
with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-
freetype-dir=/usr/X11R6 --with-gd=/usr/local". This tells PHP
to use GD and where to look for the libraries required by GD.

Another possibility might be to remove the --without-pear
option. This will tell PHP to keep using pear (for some reason
Apple has removed Pear support in its latest security update).

As you might have guessed by now, it is quite simple to tailor
PHP to your specific needs.



6. - Getting and installing the latest version of PHP5

Instead of PHP4 you may want to use PHP5. Be it because some
software you need relies on it, be it because you can. If you do
not a specific need, it is recommended you keep PHP4.

The basic steps required to install PHP5 are the same as for
PHP5. Because PHP5 cannot be integrated 100% with Server Admin
and may also create some incompatiblities (SquirrelMail for
example would have to be updated to run with PHP5), we will
install it alongside PHP4 rather than replace PHP4. Be aware
though that only one version of PHP can be running at the same
time!

So let's get going:
Make sure you are logged in as root.

Get and install the latest version of PHP5 by issuing the
following commands (in oblique type). Issue them one after the
other making sure you do not miss any dots or slashes. Also note
that the download URL given will change in the future. In that
case just change the URL with the current one. The URL used at
the time this document was written refers to PHP 5.2.10. If you
want to install a different version, adjust accordingly. Lines
wrapping without line spacing are a single command.

gcc_select 3.3
(for PPC. Use "gcc_select 4.0" for Intel)
mkdir -p /SourceCache

cd /SourceCache

curl -O http://us3.php.net/distributions/
php-5.2.10.tar.gz

tar xzpf php-5.2.10.tar.gz

cd /SourceCache/php-5.2.10

sh

CFLAGS=-DBIND_8_COMPAT

export CFLAGS


(The following is one long line starting with './configure' and
ending with 'sock')
./configure --prefix=/usr/local/php5 --mandir=/usr/
share/man --infodir=/usr/share/info --with-apxs --with-
ldap=/usr --with-kerberos=/usr --enable-cli --with-zlib-
dir=/usr --with-libxml-dir=/usr --enable-exif --enable-
ftp --enable-mbstring --enable-sockets --with-iodbc=/usr
--with-curl=/usr --with-config-file-path=/private/etc --
with-mysql=/usr --with-mysql-sock=/var/mysql/mysql.sock
(The above is one long line starting with './configure' and
ending with 'sock')

make

(Up to this point, you have only built PHP5. It has not been
installed. The next command will take care of this).

make install

sudo apachectl graceful restart

exit
You should now be all set and have PHP 5 alongside of PHP4.
Server Admin will still work as before.

/usr/local/php5/bin/php -v will tell you the version
/usr/local/php5/bin/php -i will give you more info.

A more comfortable way of seeing the details of your PHP
configuration can be achieved through a special .php file.
Create a file called info.php with the following contents:
<?php
phpinfo();
?>
When done, place it in an accessible directory of your web-
server and call it through your browser. Detailed version and
configuration information will be displayed.

As I mentioned before, only one version of PHP can be running at
the same time. Some actions in Server Admin (like turning on
webmail), will revert back to PHP4 as the running version.

Your best bet is to duplicate /etc/httpd/httpd.conf and create
one version for PHP4 and one for PHP5. This will allow you to
easily change/revert versions.

To this purpose issue:
sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.php4.conf
sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.php5.conf

Now edit /etc/httpd/httpd.php4.conf and make sure it contains
AddModule mod_php4.c
LoadModule php4_module            libexec/httpd/libphp4.so
and that those lines are uncommented.

Next edit /etc/httpd/httpd.php5.conf and make sure it contains
AddModule mod_php5.c
LoadModule php5_module            libexec/httpd/libphp5.so
and that those lines are uncommented.

Obviously you also need to make sure that each file only
contains its respective reference to PHP4 or PHP5.
Now when you want to change version just issue:
sudo cp /etc/httpd/httpd.php5.conf /etc/httpd/httpd.conf
or
sudo cp /etc/httpd/httpd.php4.conf /etc/httpd/httpd.conf
(depending which version you want)
Then issue:
sudo apachectl graceful restart
7. - Caveats
- MySQL Passwords
Depending on which version of PHP you had originally installed,
you may notice an incompatibility with mySQL authentication.

To solve it, log into MySQL at the command line by issuing:
mysql -u root -p
When asked enter your password (SQL root password)
When at the prompt
"mysql>"
SET PASSWORD FOR 'youruser'@'yourserver' =
OLD_PASSWORD('yourpassword');
(youruser, yourserver (or localhost) and yourpassword must reflect your
configuration. )

- php.ini
You may have been using a php.ini file. Certain options inside
php.ini may or may not cause issues with a later version you
install. Make sure you double check it if something doesn't
work.

- PHP4 and PHP5 can be installed but not used together.
See explanation at the end of chapter 6.

- Intel
The plain vanilla build will work for Intel Macs as well.
However if you add options that rely on external libraries, you
will need to make sure that those libraries are built for Intel
as well.

That's all folks.
Hope this helps.
Have fun,
Alex

------------------------------
Doc. Version 1.3.3, 30.6.2009
Athanasios Alexandrides
Lugano, Switzerland
tutorials -at- topicdesk.com
------------------------------

More Related Content

What's hot

Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverNginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverwruben
 
Running PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewRunning PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewWes Yanaga
 
香港六合彩
香港六合彩香港六合彩
香港六合彩csukxnr
 
How to generate,collect and upload ocum logs
How to generate,collect and upload ocum logsHow to generate,collect and upload ocum logs
How to generate,collect and upload ocum logsAshwin Pawar
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0venkatakrishnan k
 
A Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumA Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumOrangescrum
 
Windows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPWindows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPTim Keller
 
APACHE
APACHEAPACHE
APACHEARJUN
 
Dating Pro Installation Instructions
Dating Pro Installation InstructionsDating Pro Installation Instructions
Dating Pro Installation InstructionsPilot Group Ltd
 
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in UbuntuHow To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in UbuntuWirabumi Software
 
Installation instruction of Testlink
Installation instruction of TestlinkInstallation instruction of Testlink
Installation instruction of Testlinkusha kannappan
 
Apache windows
Apache windowsApache windows
Apache windowsmexxixxo
 

What's hot (18)

Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverNginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
 
Running PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewRunning PHP on Windows Technical Overview
Running PHP on Windows Technical Overview
 
Apache
ApacheApache
Apache
 
Apache
ApacheApache
Apache
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
How to generate,collect and upload ocum logs
How to generate,collect and upload ocum logsHow to generate,collect and upload ocum logs
How to generate,collect and upload ocum logs
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0
 
A Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumA Complete Installation Guide for Orangescrum
A Complete Installation Guide for Orangescrum
 
Windows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPWindows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHP
 
Its3 Drupal
Its3 DrupalIts3 Drupal
Its3 Drupal
 
APACHE
APACHEAPACHE
APACHE
 
Informix and PHP
Informix and PHPInformix and PHP
Informix and PHP
 
PHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-onPHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-on
 
Dating Pro Installation Instructions
Dating Pro Installation InstructionsDating Pro Installation Instructions
Dating Pro Installation Instructions
 
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in UbuntuHow To Install Openbravo ERP 2.50 MP43 in Ubuntu
How To Install Openbravo ERP 2.50 MP43 in Ubuntu
 
Installation instruction of Testlink
Installation instruction of TestlinkInstallation instruction of Testlink
Installation instruction of Testlink
 
Apache windows
Apache windowsApache windows
Apache windows
 

Viewers also liked

Big pipe backend2
Big pipe backend2Big pipe backend2
Big pipe backend2锐 张
 
Cibank arch-zhouweiran-qcon
Cibank arch-zhouweiran-qconCibank arch-zhouweiran-qcon
Cibank arch-zhouweiran-qconYiwei Ma
 
G416 世博开幕式焰火
G416 世博开幕式焰火G416 世博开幕式焰火
G416 世博开幕式焰火LINWEIYUAN
 
Baidu keynote-wubo-qcon
Baidu keynote-wubo-qconBaidu keynote-wubo-qcon
Baidu keynote-wubo-qconYiwei Ma
 
数据库设计方法、规范与技巧
数据库设计方法、规范与技巧数据库设计方法、规范与技巧
数据库设计方法、规范与技巧wensheng wei
 
20110625.【打造高效能的cdn系统】.易统
20110625.【打造高效能的cdn系统】.易统20110625.【打造高效能的cdn系统】.易统
20110625.【打造高效能的cdn系统】.易统锐 张
 

Viewers also liked (7)

Big pipe backend2
Big pipe backend2Big pipe backend2
Big pipe backend2
 
Cibank arch-zhouweiran-qcon
Cibank arch-zhouweiran-qconCibank arch-zhouweiran-qcon
Cibank arch-zhouweiran-qcon
 
G416 世博开幕式焰火
G416 世博开幕式焰火G416 世博开幕式焰火
G416 世博开幕式焰火
 
Baidu keynote-wubo-qcon
Baidu keynote-wubo-qconBaidu keynote-wubo-qcon
Baidu keynote-wubo-qcon
 
GNURAdioDoc-8
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
 
数据库设计方法、规范与技巧
数据库设计方法、规范与技巧数据库设计方法、规范与技巧
数据库设计方法、规范与技巧
 
20110625.【打造高效能的cdn系统】.易统
20110625.【打造高效能的cdn系统】.易统20110625.【打造高效能的cdn系统】.易统
20110625.【打造高效能的cdn系统】.易统
 

Similar to Updating_PHP_on_OS_X_Server

Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopardtutorialsruby
 
Php Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerPhp Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerJackson F. de A. Mafra
 
How to configure PHP with IIS or Apache on Windows
How to configure PHP with IIS or Apache on WindowsHow to configure PHP with IIS or Apache on Windows
How to configure PHP with IIS or Apache on WindowsRizban Ahmad
 
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffersHow%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20lafferstutorialsruby
 
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffersHow%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20lafferstutorialsruby
 
Information on PHP Handlers
Information on PHP HandlersInformation on PHP Handlers
Information on PHP HandlersHTS Hosting
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stackRootGate
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSCloudLinux
 
Wamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and ConfigurationWamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and ConfigurationChetan Soni
 
Php hypertext Preprocessor
Php hypertext PreprocessorPhp hypertext Preprocessor
Php hypertext PreprocessorMrsRLakshmiIT
 
R hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopR hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopAiden Seonghak Hong
 
Howto: Install openQRM 5.1 on Debian Wheezy
Howto: Install openQRM 5.1 on Debian WheezyHowto: Install openQRM 5.1 on Debian Wheezy
Howto: Install openQRM 5.1 on Debian WheezyopenQRM Enterprise GmbH
 

Similar to Updating_PHP_on_OS_X_Server (20)

Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
 
Phalcon - Giant Killer
Phalcon - Giant KillerPhalcon - Giant Killer
Phalcon - Giant Killer
 
Php ppt
Php pptPhp ppt
Php ppt
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
 
PHP selber bauen
PHP selber bauenPHP selber bauen
PHP selber bauen
 
Sahu
SahuSahu
Sahu
 
Php Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerPhp Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant Killer
 
How to configure PHP with IIS or Apache on Windows
How to configure PHP with IIS or Apache on WindowsHow to configure PHP with IIS or Apache on Windows
How to configure PHP with IIS or Apache on Windows
 
Php
PhpPhp
Php
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffersHow%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
 
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffersHow%20to%20install%20PHP%20on%20Linux%20_%20laffers
How%20to%20install%20PHP%20on%20Linux%20_%20laffers
 
Information on PHP Handlers
Information on PHP HandlersInformation on PHP Handlers
Information on PHP Handlers
 
Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
 
Wamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and ConfigurationWamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and Configuration
 
Php hypertext Preprocessor
Php hypertext PreprocessorPhp hypertext Preprocessor
Php hypertext Preprocessor
 
R hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopR hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing Hadoop
 
Howto: Install openQRM 5.1 on Debian Wheezy
Howto: Install openQRM 5.1 on Debian WheezyHowto: Install openQRM 5.1 on Debian Wheezy
Howto: Install openQRM 5.1 on Debian Wheezy
 

More from tutorialsruby

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 

More from tutorialsruby (20)

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Recently uploaded

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Recently uploaded (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Updating_PHP_on_OS_X_Server

  • 1. Updating PHP on Mac OS X Server 10.4.x 1. - Introduction 2. - What is installed as part of OS X Server 3. - Requirements 4. - Getting and installing the latest version of PHP4 5. - Adding/removing features to/from PHP 6. - Getting and installing the latest version of PHP5 7. - Caveats - READ this chapter! ---------------------------------------------------------------- DISCLAIMER: The author(s) claim(s) no responsibility for any damage that may occur from the use of any information found here or found on links followed from this document. The author(s) will take credit for the good stuff though. All items and/or companies mentioned on this and other pages are or may be trademarks, registered trademarks, or service marks of the respective companies or individuals. ----------------------------------------------------------------
  • 2. 1. - Introduction The purpose of this document is to provide instructions on how to update the version of PHP included with OS X 10.4.x Tiger Server. DO NOT USE this document to update PHP on 10.5.x Leopard Server. An separate tutorial is available. It will guide you through updating to the latest version of PHP4 without breaking Server Admin functionality. Furthermore you will be shown how to update to the latest version of PHP5, while retaining most of Server Admin's functionality. Although the Apple included version of PHP4 is suitable for most users, there are situations where one might need to update. A common reason is to include support for the GD2 libraries. This document will require you to use the command line. If you do not feel comfortable with using the command line, you should look for a ready made installer package. Why should I use the command line if there are ready made installer packages available? Short answer: Greater flexibility. Long answer: The packages available, reflect the creators' views on what should or shouldn't be included in the package. By understanding how to install things yourself, you can choose what to include in your PHP build. This document is written for Mac OS X 10.4.x. However, it should apply to 10.3.x as well. Be aware though that I have not done any particular testing of this procedure on 10.3.x. DISCLAIMER: Whatever you do based on this document, you do it at your own risk! Just in case you haven't understood: Whatever you do based on this document, you do it at your own risk! This tutorial has been tested on a standard Mac OS X 10.4.x Server. If you have already tinkered with your system, be aware that things might differ. It is impossible for me to foresee all changes that one might have applied to a server. This tutorial contains step-by-step instructions for the terminal. Although you could just type them in line by line, it is recommended you have a basic understanding of the terminal.
  • 3. 2. - What is installed as part of OS X Server In order to better understand OS X 10.4.x the process it is useful to have a basic knowledge of the basic installation. As of 10.4.8 and the latest security updates, Apple includes PHP 4.4.4 with its server operating system. The configuration used is as follows: ./configure --prefix=/usr --mandir=/usr/share/man -- infodir=/usr/share/info --disable-dependency-tracking -- with-apxs --with-ldap=/usr --with-kerberos=/usr -- enable-cli --with-zlib-dir=/usr --enable-trans-sid -- with-xml --enable-exif --enable-ftp --enable-mbstring -- enable-mbregex --enable-dbx --enable-sockets --with- iodbc=/usr --with-curl=/usr --with-config-file-path=/ private/etc --sysconfdir=/private/etc --with-mysql=/usr --with-mysql-sock=/var/mysql/mysql.sock --without-pear Looks scary? Don't worry, it will become clearer later on. This line basically tells PHP what modules to install and what to omit. A sample of options can be found here: http://ch2.php.net/manual/en/configure.php For those who can't wait and know what they do: to configure a freshly downloaded PHP4 version to behave exactly as Apple intended it to, just use above configuration command.
  • 4. 3. - Requirements Before you get started, you need to make sure some basic requirements are met: - You have made a backup of your system. - You have the latest version of Apple's Developer Tools (Xcode 2.4 or higher) installed. Dev Tools are available on your Server DVD and as a free download from Apple's Developer Connection. - X11 SDK is installed (available on your OS X Developer Tools Disc or Image. This is different from the X11 client that comes with OS X.) - You do have a backup - You are running 10.4.x - You have not manually updated anything related to PHP or Apache so far (if you have, you must know how to adapt these instructions to the changes you made). - You have a PPC processor - Not a requirement, but it is recommended you subscribe to our newsletter(s) or follow us on Twitter to be informed when updated versions of this tutorial become available: http://osx.topicdesk.com/newsletter/ http://twitter.com/topicdesk/
  • 5. 4. - Getting and installing the latest version of PHP4 This chapter will guide you through replacing your current version of PHP4 with the latest version available. It will not add any functionality compared to the Apple installed version. It will only give you the peace of mind to have the latest version with the most recent security fixes. If you need extra functionality, wait for the following chapters. So let's get going: Make sure you are logged in as root. Get and install the latest version of PHP by issuing the following commands (in oblique type). Issue them one after the other making sure you do not miss any dots or slashes. Also note that the download URL given will change in the future. In that case just replace the URL in this document with the current one. The URL used at the time this document was written refers to PHP 4.4.9. If you want to install a different version, adjust accordingly. Lines wrapping without line spacing are a single command. gcc_select 3.3 (for PPC. Use "gcc_select 4.0" for Intel) mkdir -p /SourceCache cd /SourceCache curl -O http://us3.php.net/distributions/ php-4.4.9.tar.gz tar xzpf php-4.4.9.tar.gz cd /SourceCache/php-4.4.9 sh CFLAGS=-DBIND_8_COMPAT export CFLAGS
  • 6. (The following is one long line starting with './configure' and ending with 'pear') ./configure --prefix=/usr --mandir=/usr/share/man -- infodir=/usr/share/info --disable-dependency-tracking -- with-apxs --with-ldap=/usr --with-kerberos=/usr -- enable-cli --with-zlib-dir=/usr --with-xml --enable-exif --enable-ftp --enable-mbstring --enable-mbregex -- enable-dbx --enable-sockets --with-iodbc=/usr --with- curl=/usr --with-config-file-path=/private/etc -- sysconfdir=/private/etc --with-mysql=/usr --with-mysql- sock=/var/mysql/mysql.sock --without-pear (The above is one long line starting with './configure' and ending with 'pear') make (Up to this point, you have only built PHP4. Your current version has not been replaced. The next command will take care of this). make install sudo apachectl graceful restart exit You should now be all set and have an "Apple compliant" version of PHP4. Server Admin will still work as before. /usr/bin/php -v will tell you the version. /usr/bin/php -i will give you more info. A more comfortable way of seeing the details of your PHP configuration can be achieved through a special .php file. Create a file called info.php with the following contents: <?php phpinfo(); ?> When done, place it in an accessible directory of your web- server and call it through your browser. Detailed version and configuration information will be displayed.
  • 7. 5. - Adding/removing features to/from PHP Besides simply replacing PHP with the latest version, one can at the same time choose additional options. The basic procedure is the same as outlined in chapter 4. The main difference is the addition/removal of configuration option. A configuration option is what follows the ./configure command. For example --with-config-file-path=/private/etc will tell PHP4 to look for its configuration file inside "--with-config- file-path=/private/etc". Some options come as part of the PHP distribution and need only to be added/removed. Others like "--with-gd" for example rely on external components to be installed on your system. Simply adding the option to ./configure will not be enough. In this particular case you would tell PHP to add support for the GD Graphics Library which you would need to install first. A separate tutorial on installing the GD Graphics Library is available on http://osx.topicdesk.com/. Let's take this as an example then. Once you have installed GD (following the other tutorial), you would repeat chapter 4 with one notable exception: The ./configure statement needs to be changed. Everything else is exactly the same. (The following is one long line starting with './configure' and ending with 'gd') ./configure --prefix=/usr --mandir=/usr/share/man -- infodir=/usr/share/info --disable-dependency-tracking -- with-apxs --with-ldap=/usr --with-kerberos=/usr -- enable-cli --with-zlib-dir=/usr --with-xml --enable-exif --enable-ftp --enable-mbstring --enable-mbregex -- enable-dbx --enable-sockets --with-iodbc=/usr --with- curl=/usr --with-config-file-path=/private/etc -- sysconfdir=/private/etc --with-mysql=/usr --with-mysql- sock=/var/mysql/mysql.sock --without-pear --with-jpeg- dir=/usr/local --with-png-dir=/usr/local --with- freetype-dir=/usr/X11R6 --with-gd=/usr/local (The above is one long line starting with './configure' and ending with 'gd')
  • 8. If you look at above ./configure statement we have added "-- with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with- freetype-dir=/usr/X11R6 --with-gd=/usr/local". This tells PHP to use GD and where to look for the libraries required by GD. Another possibility might be to remove the --without-pear option. This will tell PHP to keep using pear (for some reason Apple has removed Pear support in its latest security update). As you might have guessed by now, it is quite simple to tailor PHP to your specific needs. 6. - Getting and installing the latest version of PHP5 Instead of PHP4 you may want to use PHP5. Be it because some software you need relies on it, be it because you can. If you do not a specific need, it is recommended you keep PHP4. The basic steps required to install PHP5 are the same as for PHP5. Because PHP5 cannot be integrated 100% with Server Admin and may also create some incompatiblities (SquirrelMail for example would have to be updated to run with PHP5), we will install it alongside PHP4 rather than replace PHP4. Be aware though that only one version of PHP can be running at the same time! So let's get going: Make sure you are logged in as root. Get and install the latest version of PHP5 by issuing the following commands (in oblique type). Issue them one after the other making sure you do not miss any dots or slashes. Also note that the download URL given will change in the future. In that case just change the URL with the current one. The URL used at the time this document was written refers to PHP 5.2.10. If you want to install a different version, adjust accordingly. Lines wrapping without line spacing are a single command. gcc_select 3.3 (for PPC. Use "gcc_select 4.0" for Intel)
  • 9. mkdir -p /SourceCache cd /SourceCache curl -O http://us3.php.net/distributions/ php-5.2.10.tar.gz tar xzpf php-5.2.10.tar.gz cd /SourceCache/php-5.2.10 sh CFLAGS=-DBIND_8_COMPAT export CFLAGS (The following is one long line starting with './configure' and ending with 'sock') ./configure --prefix=/usr/local/php5 --mandir=/usr/ share/man --infodir=/usr/share/info --with-apxs --with- ldap=/usr --with-kerberos=/usr --enable-cli --with-zlib- dir=/usr --with-libxml-dir=/usr --enable-exif --enable- ftp --enable-mbstring --enable-sockets --with-iodbc=/usr --with-curl=/usr --with-config-file-path=/private/etc -- with-mysql=/usr --with-mysql-sock=/var/mysql/mysql.sock (The above is one long line starting with './configure' and ending with 'sock') make (Up to this point, you have only built PHP5. It has not been installed. The next command will take care of this). make install sudo apachectl graceful restart exit
  • 10. You should now be all set and have PHP 5 alongside of PHP4. Server Admin will still work as before. /usr/local/php5/bin/php -v will tell you the version /usr/local/php5/bin/php -i will give you more info. A more comfortable way of seeing the details of your PHP configuration can be achieved through a special .php file. Create a file called info.php with the following contents: <?php phpinfo(); ?> When done, place it in an accessible directory of your web- server and call it through your browser. Detailed version and configuration information will be displayed. As I mentioned before, only one version of PHP can be running at the same time. Some actions in Server Admin (like turning on webmail), will revert back to PHP4 as the running version. Your best bet is to duplicate /etc/httpd/httpd.conf and create one version for PHP4 and one for PHP5. This will allow you to easily change/revert versions. To this purpose issue: sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.php4.conf sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.php5.conf Now edit /etc/httpd/httpd.php4.conf and make sure it contains AddModule mod_php4.c LoadModule php4_module libexec/httpd/libphp4.so and that those lines are uncommented. Next edit /etc/httpd/httpd.php5.conf and make sure it contains AddModule mod_php5.c LoadModule php5_module libexec/httpd/libphp5.so and that those lines are uncommented. Obviously you also need to make sure that each file only contains its respective reference to PHP4 or PHP5.
  • 11. Now when you want to change version just issue: sudo cp /etc/httpd/httpd.php5.conf /etc/httpd/httpd.conf or sudo cp /etc/httpd/httpd.php4.conf /etc/httpd/httpd.conf (depending which version you want) Then issue: sudo apachectl graceful restart
  • 12. 7. - Caveats - MySQL Passwords Depending on which version of PHP you had originally installed, you may notice an incompatibility with mySQL authentication. To solve it, log into MySQL at the command line by issuing: mysql -u root -p When asked enter your password (SQL root password) When at the prompt "mysql>" SET PASSWORD FOR 'youruser'@'yourserver' = OLD_PASSWORD('yourpassword'); (youruser, yourserver (or localhost) and yourpassword must reflect your configuration. ) - php.ini You may have been using a php.ini file. Certain options inside php.ini may or may not cause issues with a later version you install. Make sure you double check it if something doesn't work. - PHP4 and PHP5 can be installed but not used together. See explanation at the end of chapter 6. - Intel The plain vanilla build will work for Intel Macs as well. However if you add options that rely on external libraries, you will need to make sure that those libraries are built for Intel as well. That's all folks. Hope this helps. Have fun, Alex ------------------------------ Doc. Version 1.3.3, 30.6.2009 Athanasios Alexandrides Lugano, Switzerland tutorials -at- topicdesk.com ------------------------------