Including PHP5 with Solaris
Stefan Teleman <Stefan.Teleman at Sun.COM>
15 March 2007
1. Summary and motivation
The inclusion of PHP5 in Solaris as a component of SAPP
[Solaris, Apache, PostgreSQL, PHP] will address a current
shortcoming of SMI's software portfolio.
The absence in Solaris of a LAMP [Linux, Apache, MySQL, PHP]
equivalent software stack has allowed Linux to create the
perception that it is the operating environment of choice for
web-based applications.
This case seeks Micro/Patch Release Binding.
2. Technical issues
2.1. Key objects.
/usr/bin/php
/usr/bin/php-config
/usr/bin/phpize
/usr/lib/libphp5-5.2.0.so
/usr/lib/libphp5.so -> /usr/lib/libphp5-5.2.0.so
/etc/php5/php.ini
All other objects will be contained within the /usr/php5/[version]
hierarchy. This hierarchy will loosely track that of the publicly
available version.
The current version of PHP5 [5.2.0] is 64-bit clean and largefile
aware. A 64-bit version of PHP is being considered for a future
release.
2.2. Versioning
The PHP5 development process follows the ubiquitous
"continuous development" model, typical of many Open Source projects.
Currently, two Releases of PHP coexist, and are still under
development: PHP4 and PHP5. Also, PHP6 is currently under active
development, and is scheduled to be released sometime during 2007.
None of these three Releases make any guarantees of API and ABI
compatibility.
The PHP versioning model has followed the <Release>.<Major>.<Minor>
model. The version of PHP5 proposed for inclusion in Solaris is PHP
5.2.0.
2.3. Directory Naming and Structure
The proposed directory layout for PHP5 is:
/usr/php5/
bin -> [version]/bin
doc -> [version]/doc
etc -> /etc/php5
include -> [version]/include
lib -> [version]/lib
man -> [version]/man
modules -> [version]/modules
share -> [version]/share
The detailed directory and file layout for PHP5 is provided in
Addendum 1.
2.4. Packaging and Delivery
The current proposal allows for the inclusion and coexistence
of multiple versions of PHP by keeping each installation under
a version-specific subdirectory. The following package naming
convention is proposed:
SUNWphp520root
SUNWphp520core
SUNWphp520usr
SUNWphp520man
SUNWphp520doc
SUNWphp520root will deliver only one file, the system-wide PHP5
configuration file:
/etc/php5/php.ini
SUNWphp520core will deliver the minimal filesystem objects for a
functional PHP5 Apache installation:
SUNWphp520core:
/usr/php5/etc -> /etc/php5
/usr/php5/[version]/lib
/usr/php5/[version]/modules
/usr/php5/lib -> /usr/php5/[version]/lib
/usr/php5/modules -> /usr/php5/[version]/modules
SUNWphp520usr will deliver the additional userland and developer
filesystem objects:
SUNWphp520usr:
/usr/php5/[version]/bin
/usr/php5/[version]/include
/usr/php5[version]/share
/usr/php5/bin -> /usr/php5/[version]/bin
/usr/php5/include -> /usr/php5/[version]/include
/usr/php5/share -> /usr/php5[version]/share
SUNWphp520doc will deliver the full and complete PHP5
documentation in HTML format.
SUNWphp520man will deliver the available man pages for PHP5:
/usr/share/man/man1/php.1
/usr/php5/[version]/man/man1/php.1
/usr/php5/[version]/man/man1/php-config.1
/usr/php5/[version]/man/man1/phpize.1
/usr/php5/man -> /usr/php5/[version]/man
3. PHP5 Modules [Extensions].
PHP supports a loadable module interface (known in PHP parlance
as "Extensions"), allowing the PHP runtime to communicate with,
and bind to, external interfaces. This module interface also allows
for the clean integration of new PHP features or bindings. In addition,
SMI may want to provide customers internally developed PHP Extensions.
PHP Extensions have an associated dynamically loadable shared object
(*.so). As mentioned earlier, PHP makes no guarantee of binary
compatibility between releases. Maintaining PHP within the constraint
of such possible binary incompatibilities motivates the directory
layout structure proposed in 2.3.
3.1. PHP Core Modules.
The initial integration will provide a subset of the PHP5
Core Extensions as delivered by the canonical PHP5 Release:
pcre [Perl-Compatible Regular Expressions]
idn [International Domain Names Resolver]
gd [Graphics Device]
exif [EXIF Metadata Information]
psql [PostgreSQL bindings]
mbstring [Multi-Byte Strings/UTF Encoding bindings]
gettext [GNU-compatible gettext binding]
iconv [GNU compatible character encoding/conversion bindings]
xml [XML bindings]
pdo [PHP Database Objects bindings]
pgsql [PostgreSQL bindings]
soap [SOAP bindings]
spl [Standard PHP Library]
ssl [OpenSSL bindings]
tcpwrap [TCPWrap bindings]
tidy [HTML parsing and validation library]
zlib [libz compression bindings]
bz2 [libbz2 compression bindings]
zip [libzip bindings]
json [JavaScript bindings]
bcmath [Binary Calculator Math bindings]
calendar [Calendar bindings]
ctype [Character bindings]
curl [C-URL bindings]
dom [DOM XSLT bindings]
posix [POSIX bindings]
sockets [libsocket bindings]
session [PHP Session bindings]
suhosin [Hardened PHP Extension]
apc [Advanced PHP Caching Extension]
Additional Extensions can be delivered subsequent to the initial
PHP5 integration, depending on customer requests, and on the
availability of the external dependencies required by these Extensions.
4. PHP5 Internationalization.
PHP5 provide basic I18N support via its ctype/gettext/iconv/mbstring
Extensions. As an externally developed application, PHP5 will not
provide additional Internationalization support beyond what is provided
by the canonical distribution.
5. PHP5 Documentation.
PHP5 comes with an exhaustive set of documentation available in several
languages from the PHP Site [http://www.php.net/docs.php] [2].
5.1. Full Adoption.
The full PHP5 documentation is available for download from the PHP Site
[http://www.php.net/download-docs.php] [3]. This documentation set
should be placed in the separate [doc] directory for each PHP5 Release
[/usr/php5/[version]/doc], with an appropriate symbolic link to
/usr/php5/doc.
5.2. Manual Pages.
PHP5 provides a default man page [php(1)]. This man page will be
delivered in the appropriate man directory [/usr/php5/[version]/man],
with an appropriate symbolic link to /usr/php5/man. The contents of
this man page is provided in Addendum 2.
A generic man page will be delivered in the standard Solaris man
directory (/usr/share/man/man1/php.1). This man page will follow
the model introduced by Perl5 [PSARC 1999/192], and will provide
a complete listing of available PHP5 man pages [php(1), phpize(1)
and php-config(1)]. The contents of this man page is provided in
Addendum 3.
6. Interfaces
6.1. Interface Stability.
PHP, as an Open Source project, is controlled by a group of developers
external of, and independent from, SMI. The PHP Group makes no
guarantees or promises of ABI or API compatibility between PHP releases.
6.2. Imported Interfaces.
NAME NOTES
Apache 2.2.4 APR Libraries PSARC/2007/000
OpenSSL [Secure Sockets Layer] PSARC/2003/500
PCRE [Perl-Compatible Regular Expressions] PSARC/2007/000
IDN [Internationalized Domain Library] PSARC/2007/000
GD [Graphics Device Library] PSARC/2007/000
EXIF [EXIF Metadata Information] PSARC/2007/000
PostgreSQL LSARC/2006/655
TCPWrap [TCP Wrappers Library] PSARC/2001/709
Tidy [HTML Validation Library] PSARC/2007/134
Z-lib [Zlib Compression Library] PSARC/2006/537
BZ2 [bz2 Compression Library] PSARC/1999/555
ZIP [Zip Compression Library] PSARC/1999/555
CURL [C-URL Library] PSARC/2007/000
LibXML [XML Library] PSARC/2001/175
LibXSLT [XSLT Transformation Library] PSARC/2002/244
LibFreetype 2 [Freetype Library] LSARC/2005/397
LibFontconfig [Fontconfig Library] LSARC/2003/273
LibXft2 [Xft2 Library] LSARC/2003/274
LibDTrace [D-Trace Library] PSARC/2001/466
6.3. Exported Interfaces.
PHP5 implements two types of Exported Interfaces. The first type
[Type 1] is a one-to-one mappping between a physical filesystem
object, and its associated Interfaces. The second type [Type 2] is
a virtual mapping of two distinct Interface Objects: a physical
filesystem object and an Interface moniker handle which may, or
may not act as a provider of programmatic interface(s). Not all
Type 2 Interfaces provide a programmatic interface. Typically,
but not always, Type 2 Interfaces which do not provide a programmatic
interface, provide a configuration interface via the php.ini file.
This Type 2 Interface is characteristic of PHP5's Extensions.
Also characteristic of the Type 2 Interface is the property
that physical filesystem object Interfaces are always Private and
implicitly Volatile, whereas their corresponding programmatic, or
configuration interfaces, if they exist, are public and Uncommitted.
NAME STABILITY NOTES
SUNWphp520core Uncommitted Package Name
SUNWphp520usr Uncommitted Package Name
SUNWphp520man Uncommitted Package Name
SUNWphp520doc Uncommitted Package Name
/usr/php5/[version]/bin/php Uncommitted Executable location
/usr/php5/bin/php Uncommitted Symbolic link
/usr/bin/php Uncommitted Symbolic link
/usr/php5/[version]/bin/phpize Uncommitted Executable location
/usr/php5/bin/phpize Uncommitted Symbolic link
/usr/php5/[version]/bin/php-config Uncommmited Executable
location
/usr/php5/bin/php-config Uncommitted Symbolic link
/etc/php5/php.ini Uncommitted Configuration file
/usr/php5/[version]/etc/php.ini Uncommitted Symbolic link
/usr/php5/etc/php.ini Uncommitted Symbolic link
/usr/php5/[version]/lib/libphp5-5.2.0.so Uncommitted PHP
Library
/usr/php5/lib/libphp5-5.2.0.so Uncommitted Symbolic link
/usr/lib/libphp5-5.2.0.so Uncommitted Symbolic link
/usr/apache2/modules/libphp5-5.2.0.so Uncommitted Symbolic link
/usr/apache2/modules/libphp5.so Uncommitted Symbolic link
/usr/php5/[version]/include/TSRM/ Uncommitted Include files
/usr/php5/[version]/include/Zend/ Uncommitted Include files
/usr/php5/[version]/include/php/ext/ Uncommitted Include files
apc Uncommitted APC Extension
bcmath Uncommitted BC Math Extension
bz2 Uncommitted BZ2 Extension
calendar Uncommitted Calendar Extension
ctype Uncommitted Character Extension
curl Uncommitted C-URL Extension
dba Uncommitted Database Access Extension
dom Uncommitted XML DOM Extension
dtrace Uncommitted DTrace Extension
exif Uncommitted EXIF Extension
filter Uncommitted Filter Extension
ftp Uncommitted FTP Extension
gd Uncommitted GD Extension
gettext Uncommitted Gettext Extension
hash Uncommitted PHP Hashing Extension
iconv Uncommitted GNU Iconv Compatible Extension
json Uncommitted JavaScript Object Notation Extension
libxml Uncommitted LibXML Extension
mbstring Uncommitted Multi-byte Strings Extension
openssl Uncommitted OpenSSL Extension
pcntl Uncommitted Process Control Extension
pcre Uncommitted PCRE Extension
pdo Uncommitted PHP Database Objects Extension
pdo_pgsql Uncommitted PostgreSQL PHP Database Objects
Extension
pgsql Uncommitted PHP PostgreSQL Native Extension
posix Uncommitted PHP POSIX Emulation Extension
session Uncommitted PHP Session Management Extension
shmop Uncommitted PHP Shared Memory Extension
simplexml Uncommitted PHP XML Extension
soap Uncommitted PHP SOAP Extension
sockets Uncommitted PHP Sockets Extension
spl Uncommitted Standard PHP Library Extension
suhosin Uncommitted Hardened PHP Security Extension
sysvmsg Uncommitted SVR4 IPC Extension
sysvsem Uncommitted SVR4 Semaphores Extension
sysvshm Uncommitted SVR4 Shared memory Extension
tcpwrap Uncommitted TCP Wrapper Library Extension
tidy Uncommitted TIDY Library Extension
tokenizer Uncommitted PHP Tokenizer Parser Extension
xml Uncommitted LibXML Extension
xlmreader Uncommitted LibXML Reader Extension
xmlrpc Uncommitted LibXML RPC Extension
xmlwriter Uncommitted LibXML Writer Extension
xsl Uncommitted LibXSLT Extension
zip Uncommitted ZIP Compression Extension
zlib Uncommitted ZLib Compression Extension
7. References.
[1] http://www.php.net/
[2] http://www.php.net/docs.php
[3] http://www.php.net/download-docs.php
[4] http://www.php.net/license/3_01.txt
[5] http://bugs.php.net/
[6] http://www.libgd.org/
[7] http://curl.haxx.se/
[8] http://www.pcre.org/
[9] http://tidy.sourceforge.net/
[10] http://sourceforge.net/project/showfiles.php?group_id=12272
[11] http://www.littlecms.com/
[12] http://www.gnu.org/software/libidn/
[13] http://www.hardened-php.net/
[14] http://www.postgresql.org/
[15] http://www.apache.org/
[16] http://www.xmlsoft.org/
[17] http://www.openssl.org/
--
Stefan Teleman
Sun Microsystems, Inc.
Stefan.Teleman at Sun.COM