AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
  • 1.  Compilation PHP for IBM HTTP Server (IHS)

    Posted Wed June 09, 2010 06:13 PM

    Originally posted by: Patraix


    I'm trying to compile PHP following approach provided by IBM. The configuration is as follows:

    AIX 5.3
    IHS 7.0
    PHP 5.3.2

    I also tried with IHS 6.1 and PHP 5.2.13, but I get the same result.

    I do the configuration with the following command:

    
    ./Configure --with-apxs2=/usr/IBM/HTTPServer7/bin/apxs --with-config-file-path=/usr/IBM/HTTPServer7/conf --enable-maintainer-zts
    


    NOTE: I removed the "mysql" from the approach, because MySQL will not be used on this server.

    I get the following error message:
    
    ........ verbose =
    '' with_apxs2 = /usr/IBM/HTTPServer7/bin/apxs with_config_file_path = /usr/IBM/HTTPServer7/conf withval = /usr/IBM/HTTPServer7/bin/apxs x_includes = NONE x_libraries = NONE expr: syntax error configure: error: You have enabled Apache 2 support 
    
    while your Server is Apache 1.3. Please use the appropiate 
    
    switch - with-apxs (without the 2)
    


    Yet it's clear that IHS 7 uses Apache 2.2.8 (and IHS 6.1 uses apache 2.0.47).
    
    root@localhost:/usr/IBM/HTTPServer7/bin>./apachectl -V Server version: IBM_HTTP_Server/7.0.0.0 (Unix) Apache version: 2.2.8 (with additional fixed) ....
    

    #AIX-Forum


  • 2.  Re: Compilation PHP for IBM HTTP Server (IHS)

    Posted Thu June 10, 2010 01:15 AM

    Originally posted by: jklotz


    The following article has proven to be of good help in my case (I used latest stable Apache version from their web site), altough I had no problems with apxs :

    http://www.pseriestech.org/forum/tutorials/compiling-apache2-php-5-1-aix-105.html

    However the whole process has been tricky, as I encountered minor but time consuming problems at almost each step ...

    Regarding your problem, if you look at the output, you have the "expr:error" message, could it be the true problem lies here ? Expr is a command (not sure if it' shell builtin or external command), and the point is that open source software compilation often relies on a bunch of GNU Tools, necessiting to install several (many) rpm's. Installing for example bash.rpm and using export CONFIG_SHELL=/opt/freeware/bin/bash is often a good start. Before running the configure script, making export PATH=/opt/freeware/bin:$PATH is often a good thing (sometimes it's not).

    You might also find more easy to download binaries directly from http://perzl.org.
    #AIX-Forum


  • 3.  Re: Compilation PHP for IBM HTTP Server (IHS)

    Posted Thu June 10, 2010 01:56 PM

    Originally posted by: Patraix


    You look right the error seems in "expr" and not related to apache.

    I maybe doing some tricky test but I look in "configure.in" and found the following command:

    
    PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
    


    Indeed, if I run this command I receive "expr: syntax error". I currently to look if I can fix that...
    #AIX-Forum


  • 4.  Re: Compilation PHP for IBM HTTP Server (IHS)

    Posted Thu June 10, 2010 02:29 PM

    Originally posted by: Patraix


    That was the case, but I changed this same command in "configure" file instead of "configure.in"

    Required changes are:

    
    PHP_VERSION_ID=`expr 
    {[$]PHP_MAJOR_VERSION \* 10000
    } + 
    {[$]PHP_MINOR_VERSION \* 100
    } + [$]PHP_RELEASE_VERSION`
    

    #AIX-Forum


  • 5.  Re: Compilation PHP for IBM HTTP Server (IHS)

    Posted Thu June 10, 2010 06:18 PM

    Originally posted by: Patraix


    Sorry previous post was wrong... Maybe I drank too much coffee and I posted too fast :)

    I have now the complete solution, but I have to explain the problem.

    The compile script uses "apxs" to ask configuration of the server. Like "apxs -q SBINDIR" to get the bin directory of HTTP Server installation, and (really important in this issue) "apxs -q TARGET" that returns the exec file of the server. The "configure" script executes that:

    
    APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
    


    That sets APXS_HTTPD=/usr/IBM/HTTPServer/bin/httpd ... and few line later:

    
    ac_output=`$APXS_HTTPD -v 2>&1 | grep version`
    


    But, in the case that IBM HTTP Server uses by default apachectl and not httpd, for a reason or another "httpd" can't run by default:

    
    root@localhost:/usr/IBM/HTTPServer/bin > ./httpd -v Could not load program ./httpd: Dependent module libaprutil-0.so could not be loaded. Could not load module libaprutil-0.so. System error: No such file or directory
    


    So you have run the following command to set lib path in environment: (dont forget the space after the dot...)

    
    . /usr/IBM/HTTPServer/bin/envvars
    


    Then,
    
    root@localhost:/usr/IBM/HTTPServer/bin > ./httpd -v Server version: IBM_HTTP_Server/6.1 Apache/2.0.47 Server built:   Apr 20 2006 07:37:05
    


    But, It doesn't end as easily, note that IBM added the IBM_HTTP_Server version value on the line... So when "expr" try to read value like that:

    
    APACHE_VERSION=`expr $4 \* 1000000 + $5 \* 1000 + $6`
    


    Values 4, 5 and 6 are "6", "1" and "Apache"... (read the script and expr manual to understand this part)

    So you need to modify this part also:

    
    APACHE_VERSION=`expr $7 \* 1000000 + $8 \* 1000 + $9`
    


    That's line 6303 regarding my configuration (4 sections like that are used in the script... you have to find which cases is selected related to your configurations...)

    Then... Some problems with phar.php (hahah...) on compilation.

    Simply add "--disable-phar" to configuration parameters. I think, correct me if i'm wrong, phar is related something like war (java) file but PHP version.... i'm not sure, but I don't need it.

    
    ./configure --with-apxs2=/usr/IBM/HTTPServer/bin/apxs --with-config-file-path=/usr/IBM/HTTPServer/conf --enable-maintainer-zts --disable-phar
    


    make...

    Et voilà!
    #AIX-Forum


  • 6.  Re: Compilation PHP for IBM HTTP Server (IHS)

    Posted Fri June 11, 2010 07:56 AM

    Originally posted by: jklotz


    "But, in the case that IBM HTTP Server uses by default apachectl and not httpd, for a reason or another "httpd" can't run by default"

    htppd is an executable compiled for run-time linking (symbols resolved at execution), and I guess it needs the LIBPATH variable as it is set in the envvars file (however if I look on a system next to me, IHS v2.0.63 has library path hardcoded in the executable header).
    Nice investigation :)

    More info about phar : http://www.php.net/manual/en/phar.using.intro.php
    It seems safe to ignore, unless you have to manipulate .phar files.
    #AIX-Forum


  • 7.  Re: Compilation PHP for IBM HTTP Server (IHS)

    Posted Fri October 28, 2011 07:48 AM

    Originally posted by: SystemAdmin


    I'm facing a different issue w/ PHP 5 on IHS7.

    The configuration is as follows:

    x86_64 GNU/Linux (RedHat) Kernel 2.6.18
    PHP 5.3.3
    Linux64 WAS 7.0.0.17 w/ IHS

    Using the following config parameters:

    ./configure --with-apxs2=/hosting/configs/IBMHttpServerD01/bin/apxs --with-mysql

    I get the error:

    load /hosting/configs/IBMHttpServerD01/modules/libphp5.so into server: /hosting/configs/IBMHttpServerD01/modules/libphp5.so: wrong ELF class: ELFCLASS32

    Which signifies that I need the 64-bit libraries, so I use the 64-bit library caonfig parameters:

    ./configure --with-apxs2=/hosting/configs/IBMHttpServerD01/bin/apxs --with-libdir=lib64 --with-mysql

    And I get the errror:

    load /hosting/configs/IBMHttpServerD01/modules/libphp5.so into server: /hosting/configs/IBMHttpServerD01/modules/libphp5.so: wrong ELF class: ELFCLASS364

    On the local Apache (default) installation, the 64_bit option works fine, but still will not load under IHS7.

    Any thoughts on this one?
    #AIX-Forum