Until this manual section is rewritten, the documentation about compiling
PHP (and related extensions) on HP-UX systems has been removed. For now,
consider reading the following external resource:
» Building Apache and PHP on HP-UX 11.11

User Contributed Notes 8 notes

To build for HP-UX 10.X/11.X (and some other UNIX variants) with '--enable-sockets', you'll get an error about 'u_int' being redefined in /usr/include/netinet/in.h and ext/sockets/sockets.c will fail to compile. The problem is this line from main/php_config.h:#define in_addr_t u_int

The above define is a problem because HP-UX (and some other UNIXs) typedef in_addr_t. A good workaround is to replace this define in main/php_config.h with the lines from the HP-UX 11.X netinet/in.h header file (which will work for 10.X as well):#ifndef _IN_ADDR_T#define _IN_ADDR_T#ifdef __LP64__ typedef unsigned int in_addr_t;#else typedef unsigned long in_addr_t;#endif#endif

If you need an Apache2-Server with PHP4 under HP-UX 11.x, it's a good way to download the HP-WebServer from the HP-Website (http://software.hp.com). The HP-Webserver comes with numerous moduls. First install the HP-Webserver (swinstall -s /absolute_path_to_depot_file/name_of_depot_file). After that, download the newest PHP-Version from http://www.php.net (HP ships the HP-Webserver with an old PHP-Version) and unpack the tar-file in a working-directory.

Use the following parameters for configure PHP:./configure --with-apxs2=/opt/hpws/apache/bin/apxs --prefix=/opt/hpws/apache/php [and so on...]

For PHP 4.0.6 under HP-UX 11.00, I ran into errors during the compilation related to "LC_CTYPE" and other "LC_" vars. The compilation complained that "LC_" such and such first used in such and such function. (I think the error first came up in php_pcre.c, then in basic_functions.c). The solution was to add "#include <locale.h>" to the php.h file. Compilation was successful after that was added, with no other issues. Used gcc 2.95.3, apache 1.3.20, bison 1.28, flex 2.5.4.a.

Just a quick point to those of you (like me!) who might not be sharp enough to notice this: If you want to install PHP on an HP-UX 11.x box then you'll need to download and install the 11.x (not 10.20) versions of the software (like gcc and bison). I didn't notice this and spent a large proportion of a day trying to figure out why the software wouldn't install!
Steve

HP-UX 11.X PA-RISC installation with oracle (oci8). You need to install the HP-UX patch PHSS_22514 patch (updated libdld.sl), otherwise you will get errors with dlopen() and dlclose() not found during the apache integration stage.