Including PHP5 with Solaris Stefan Teleman 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/php5/[version]/bin/php /usr/php5/[version]/bin/php-config /usr/php5/[version]/bin/phpize /usr/php5/[version]/bin/64/php /usr/php5/[version]/bin/64/php-config /usr/php5/[version]/bin/64/phpize /usr/php5/[version]/lib/libphp5-5.2.0.so /usr/php5/[version]/lib/libphp5.so -> /usr/php5/[version]/lib/libphp5-5.2.0.so /usr/php5/[version]/lib/64/libphp5-5.2.0.so /usr/php5/[version]/lib/64/libphp5.so -> /usr/php5/[version]/lib/64/libphp5-5.2.0.so /usr/php5/[version]/etc/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 .. 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/ [version]/bin [version]/bin/64 [version]/doc [version]/etc [version]/include [version]/lib [version]/lib/64 [version]/man [version]/modules/64 [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 for each particular PHP release: /etc/php5/[version]/php.ini SUNWphp520core will deliver the minimal filesystem objects for a functional PHP5 Apache installation: SUNWphp520core: /usr/php5/[version]/lib /usr/php5/[version]/lib/64 /usr/php5/[version]/modules /usr/php5/[version]/modules/64 SUNWphp520usr will deliver the additional userland and developer filesystem objects: SUNWphp520usr: /usr/php5/[version]/bin /usr/php5/[version]/bin/64 /usr/php5/[version]/include /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 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 collection should be placed in the separate [doc] directory for each PHP5 Release [/usr/php5/[version]/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 STABILITY NOTES Apache 2.2 APR Libraries Uncommitted PSARC/2007/169 OpenSSL [Secure Sockets Layer] External/Volatile PSARC/2003/500 PCRE [Perl-Compatible Regular Expressions] Uncommitted PSARC/2007/164 IDN [Internationalized Domain Library] Uncommitted PSARC/2007/167 GD [Graphics Device Library] Uncommitted PSARC/2007/166 EXIF [EXIF Metadata Information] Uncommitted LSARC/2006/202 PostgreSQL Uncommitted LSARC/2006/655 TCPWrap [TCP Wrappers Library] Evolving PSARC/2001/709 Tidy [HTML Validation Library] Uncommitted PSARC/2007/134 Z-lib [Zlib Compression Library] Committed PSARC/2006/537 BZ2 [bz2 Compression Library] Standard PSARC/1999/555 ZIP [Zip Compression Library] Standard PSARC/1999/555 CURL [C-URL Library] Uncommitted PSARC/2007/165 LibXML [XML Library] Standard PSARC/2001/175 LibXSLT [XSLT Transformation Library] Evolving PSARC/2002/244 LibFreetype 2 [Freetype Library] External LSARC/2005/397 LibFontconfig [Fontconfig Library] External LSARC/2003/273 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/[version]/bin/64/php Uncommitted Executable location /usr/php5/[version]/bin/phpize Uncommitted Executable location /usr/php5/[version]/bin/64/phpize Uncommitted Executable location /usr/php5/[version]/bin/php-config Uncommmited Executable location /usr/php5/[version]/bin/64/php-config Uncommmited Executable location /etc/php5/[version]/php.ini Uncommitted Configuration file /usr/php5/[version]/lib/libphp5-[version].so Uncommitted PHP Library /usr/php5/[version]/lib/libphp5.so -> libphp5-[version].so Uncommitted Symbolic link /usr/php5/[version]/lib/64/libphp5-[version].so Uncommitted PHP Library /usr/php5/[version]/lib/64/libphp5.so -> libphp5-[version].so Uncommitted Symbolic Link /usr/php5/[version]/include/TSRM/TSRM.h /usr/php5/[version]/include/TSRM/acconfig.h /usr/php5/[version]/include/TSRM/readdir.h /usr/php5/[version]/include/TSRM/tsrm_config.h /usr/php5/[version]/include/TSRM/tsrm_config.w32.h /usr/php5/[version]/include/TSRM/tsrm_config_common.h /usr/php5/[version]/include/TSRM/tsrm_nw.h /usr/php5/[version]/include/TSRM/tsrm_strtok_r.h /usr/php5/[version]/include/TSRM/tsrm_virtual_cwd.h /usr/php5/[version]/include/TSRM/tsrm_win32.h /usr/php5/[version]/include/Zend/FlexLexer.h /usr/php5/[version]/include/Zend/acconfig.h /usr/php5/[version]/include/Zend/zend.h /usr/php5/[version]/include/Zend/zend_API.h /usr/php5/[version]/include/Zend/zend_alloc.h /usr/php5/[version]/include/Zend/zend_builtin_functions.h /usr/php5/[version]/include/Zend/zend_compile.h /usr/php5/[version]/include/Zend/zend_config.h /usr/php5/[version]/include/Zend/zend_config.nw.h /usr/php5/[version]/include/Zend/zend_config.w32.h /usr/php5/[version]/include/Zend/zend_constants.h /usr/php5/[version]/include/Zend/zend_dynamic_array.h /usr/php5/[version]/include/Zend/zend_errors.h /usr/php5/[version]/include/Zend/zend_exceptions.h /usr/php5/[version]/include/Zend/zend_execute.h /usr/php5/[version]/include/Zend/zend_extensions.h /usr/php5/[version]/include/Zend/zend_fast_cache.h /usr/php5/[version]/include/Zend/zend_globals.h /usr/php5/[version]/include/Zend/zend_globals_macros.h /usr/php5/[version]/include/Zend/zend_hash.h /usr/php5/[version]/include/Zend/zend_highlight.h /usr/php5/[version]/include/Zend/zend_indent.h /usr/php5/[version]/include/Zend/zend_ini.h /usr/php5/[version]/include/Zend/zend_ini_parser.h /usr/php5/[version]/include/Zend/zend_ini_scanner.h /usr/php5/[version]/include/Zend/zend_interfaces.h /usr/php5/[version]/include/Zend/zend_istdiostream.h /usr/php5/[version]/include/Zend/zend_iterators.h /usr/php5/[version]/include/Zend/zend_language_parser.h /usr/php5/[version]/include/Zend/zend_language_scanner.h /usr/php5/[version]/include/Zend/zend_list.h /usr/php5/[version]/include/Zend/zend_llist.h /usr/php5/[version]/include/Zend/zend_mm.h /usr/php5/[version]/include/Zend/zend_modules.h /usr/php5/[version]/include/Zend/zend_multibyte.h /usr/php5/[version]/include/Zend/zend_multiply.h /usr/php5/[version]/include/Zend/zend_object_handlers.h /usr/php5/[version]/include/Zend/zend_objects.h /usr/php5/[version]/include/Zend/zend_objects_API.h /usr/php5/[version]/include/Zend/zend_operators.h /usr/php5/[version]/include/Zend/zend_ptr_stack.h /usr/php5/[version]/include/Zend/zend_qsort.h /usr/php5/[version]/include/Zend/zend_stack.h /usr/php5/[version]/include/Zend/zend_static_allocator.h /usr/php5/[version]/include/Zend/zend_stream.h /usr/php5/[version]/include/Zend/zend_strtod.h /usr/php5/[version]/include/Zend/zend_ts_hash.h /usr/php5/[version]/include/Zend/zend_types.h /usr/php5/[version]/include/Zend/zend_variables.h /usr/php5/[version]/include/Zend/zend_vm.h /usr/php5/[version]/include/Zend/zend_vm_def.h /usr/php5/[version]/include/Zend/zend_vm_execute.h /usr/php5/[version]/include/Zend/zend_vm_opcodes.h /usr/php5/[version]/include/php/ext/date/php_date.h /usr/php5/[version]/include/php/ext/date/lib/timelib.h /usr/php5/[version]/include/php/ext/date/lib/timelib_config.h /usr/php5/[version]/include/php/ext/date/lib/timelib_structs.h /usr/php5/[version]/include/php/ext/dom/xml_common.h /usr/php5/[version]/include/php/ext/gd/gdcache.h /usr/php5/[version]/include/php/ext/gd/gdttf.h /usr/php5/[version]/include/php/ext/gd/php_gd.h /usr/php5/[version]/include/php/ext/hash/php_hash.h /usr/php5/[version]/include/php/ext/hash/php_hash_adler32.h /usr/php5/[version]/include/php/ext/hash/php_hash_crc32.h /usr/php5/[version]/include/php/ext/hash/php_hash_gost.h /usr/php5/[version]/include/php/ext/hash/php_hash_haval.h /usr/php5/[version]/include/php/ext/hash/php_hash_md.h /usr/php5/[version]/include/php/ext/hash/php_hash_ripemd.h /usr/php5/[version]/include/php/ext/hash/php_hash_sha.h /usr/php5/[version]/include/php/ext/hash/php_hash_snefru.h /usr/php5/[version]/include/php/ext/hash/php_hash_tiger.h /usr/php5/[version]/include/php/ext/hash/php_hash_types.h /usr/php5/[version]/include/php/ext/hash/php_hash_whirlpool.h /usr/php5/[version]/include/php/ext/iconv/php_iconv.h /usr/php5/[version]/include/php/ext/iconv/php_have_bsd_iconv.h /usr/php5/[version]/include/php/ext/iconv/php_have_glibc_iconv.h /usr/php5/[version]/include/php/ext/iconv/php_have_iconv.h /usr/php5/[version]/include/php/ext/iconv/php_have_libiconv.h /usr/php5/[version]/include/php/ext/iconv/php_iconv_supports_errno.h /usr/php5/[version]/include/php/ext/iconv/php_php_iconv_h_path.h /usr/php5/[version]/include/php/ext/iconv/php_php_iconv_impl.h /usr/php5/[version]/include/php/ext/libxml/php_libxml.h /usr/php5/[version]/include/php/ext/mbstring/mbstring.h /usr/php5/[version]/include/php/ext/mbstring/php_mbregex.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/config.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/eaw_table.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfilter.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfilter_pass.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_consts.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_convert.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_defs.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_ident.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_language.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h /usr/php5/[version]/include/php/ext/mbstring/libmbfl/mbfl/mbfl_string.h /usr/php5/[version]/include/php/ext/mbstring/oniguruma/oniguruma.h /usr/php5/[version]/include/php/ext/mbstring/oniguruma/php_onig_compat.h /usr/php5/[version]/include/php/ext/pdo/php_pdo.h /usr/php5/[version]/include/php/ext/pdo/php_pdo_driver.h /usr/php5/[version]/include/php/ext/session/mod_files.h /usr/php5/[version]/include/php/ext/session/mod_user.h /usr/php5/[version]/include/php/ext/session/php_session.h /usr/php5/[version]/include/php/ext/standard/base64.h /usr/php5/[version]/include/php/ext/standard/basic_functions.h /usr/php5/[version]/include/php/ext/standard/crc32.h /usr/php5/[version]/include/php/ext/standard/credits.h /usr/php5/[version]/include/php/ext/standard/credits_ext.h /usr/php5/[version]/include/php/ext/standard/credits_sapi.h /usr/php5/[version]/include/php/ext/standard/css.h /usr/php5/[version]/include/php/ext/standard/cyr_convert.h /usr/php5/[version]/include/php/ext/standard/datetime.h /usr/php5/[version]/include/php/ext/standard/dl.h /usr/php5/[version]/include/php/ext/standard/dns.h /usr/php5/[version]/include/php/ext/standard/exec.h /usr/php5/[version]/include/php/ext/standard/file.h /usr/php5/[version]/include/php/ext/standard/flock_compat.h /usr/php5/[version]/include/php/ext/standard/fsock.h /usr/php5/[version]/include/php/ext/standard/head.h /usr/php5/[version]/include/php/ext/standard/html.h /usr/php5/[version]/include/php/ext/standard/info.h /usr/php5/[version]/include/php/ext/standard/md5.h /usr/php5/[version]/include/php/ext/standard/microtime.h /usr/php5/[version]/include/php/ext/standard/pack.h /usr/php5/[version]/include/php/ext/standard/pageinfo.h /usr/php5/[version]/include/php/ext/standard/php_array.h /usr/php5/[version]/include/php/ext/standard/php_assert.h /usr/php5/[version]/include/php/ext/standard/php_browscap.h /usr/php5/[version]/include/php/ext/standard/php_crypt.h /usr/php5/[version]/include/php/ext/standard/php_dir.h /usr/php5/[version]/include/php/ext/standard/php_ext_syslog.h /usr/php5/[version]/include/php/ext/standard/php_filestat.h /usr/php5/[version]/include/php/ext/standard/php_fopen_wrappers.h /usr/php5/[version]/include/php/ext/standard/php_ftok.h /usr/php5/[version]/include/php/ext/standard/php_http.h /usr/php5/[version]/include/php/ext/standard/php_image.h /usr/php5/[version]/include/php/ext/standard/php_incomplete_class.h /usr/php5/[version]/include/php/ext/standard/php_iptc.h /usr/php5/[version]/include/php/ext/standard/php_lcg.h /usr/php5/[version]/include/php/ext/standard/php_link.h /usr/php5/[version]/include/php/ext/standard/php_mail.h /usr/php5/[version]/include/php/ext/standard/php_math.h /usr/php5/[version]/include/php/ext/standard/php_metaphone.h /usr/php5/[version]/include/php/ext/standard/php_rand.h /usr/php5/[version]/include/php/ext/standard/php_smart_str.h /usr/php5/[version]/include/php/ext/standard/php_smart_str_public.h /usr/php5/[version]/include/php/ext/standard/php_standard.h /usr/php5/[version]/include/php/ext/standard/php_string.h /usr/php5/[version]/include/php/ext/standard/php_type.h /usr/php5/[version]/include/php/ext/standard/php_uuencode.h /usr/php5/[version]/include/php/ext/standard/php_var.h /usr/php5/[version]/include/php/ext/standard/php_versioning.h /usr/php5/[version]/include/php/ext/standard/proc_open.h /usr/php5/[version]/include/php/ext/standard/quot_print.h /usr/php5/[version]/include/php/ext/standard/reg.h /usr/php5/[version]/include/php/ext/standard/scanf.h /usr/php5/[version]/include/php/ext/standard/sha1.h /usr/php5/[version]/include/php/ext/standard/streamsfuncs.h /usr/php5/[version]/include/php/ext/standard/uniqid.h /usr/php5/[version]/include/php/ext/standard/url.h /usr/php5/[version]/include/php/ext/standard/url_scanner.h /usr/php5/[version]/include/php/ext/standard/url_scanner_ex.h /usr/php5/[version]/include/php/ext/xml/php_xml.h /usr/php5/[version]/include/php/ext/xml/expat_compat.h 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/