z/OS Tools & Language

Expand all | Collapse all

PHP 5.4.4 not working under IHS 8.5.5.9

  • 1.  PHP 5.4.4 not working under IHS 8.5.5.9

    Posted 04-15-2016 12:01

    I’m testing php 5.4.4 to replace the ibm ported php 5.1.2 under IBM HTTP server 8.5.5.9.

    with the IBM ported php, i have a cgi called php, which is a shell script that then executes the php cgi program, with the php script name from the url. With php 5.1.2, I can run a php script that does the print phpinfo() and I get the proper html page back.

    When i change my php shell script to use the 5.4.4 php_cgi, I don’t get any output back. Instead I get a 404 error page in my browser, but neither the web or php error logs show any problem.

    Have you run into this issue? What do I need to do in order to get this working with the 5.4.4?

    Thanks,
    Peter



  • 2.  RE: PHP 5.4.4 not working under IHS 8.5.5.9

    Posted 04-18-2016 04:38

    Hi Peter,

    Is it possible to share following files:

    • http.conf
    • php.ini
    • your shell script that executes the php cgi

    Thanks,
    Andrey



  • 3.  RE: PHP 5.4.4 not working under IHS 8.5.5.9

    Posted 04-19-2016 10:55

    Here you goRocket.tar (107 KB)



  • 4.  RE: PHP 5.4.4 not working under IHS 8.5.5.9

    Posted 04-20-2016 08:07

    Hi Peter,

    One of possible problems is “cgi.fix_pathinfo”. Please check the “cgi.fix_pathinfo” parameter(php.ini). It should be set to 0 and without “;”.
    like:
    cgi.fix_pathinfo=0

    We met this problem previously. Please inform us about your results.

    Thanks,
    Andrey



  • 5.  RE: PHP 5.4.4 not working under IHS 8.5.5.9

    Posted 04-20-2016 11:53

    That took care of the issue.

    Thanks,
    Peter



  • 6.  RE: PHP 5.4.4 not working under IHS 8.5.5.9

    Posted 05-06-2016 06:11

    Hi Peter

    I had the same problem in the same configuration.
    I replaced CGI by FastCGI which in the end should also improve performance.

    httpd.conf (extract) :

    LoadModule fastcgi_module modules/mod_fastcgi.so
    <IfModule mod_fastcgi.c>
      AddHandler fastcgi-script .fcgi
      FastCgiIpcDir /local/basepro/httpserv/fastcgi
      FastCgiConfig -autoUpdate -singleThreshold 100 -killInterval 300 -maxProcesses 10 -maxClassProcesses 1
      AddType    application/x-httpd-php .php
      AddHandler php-fcgi .php
      Action     php-fcgi /php/php.fcgi
      ScriptAlias /php/  "/local/basepro/outdev/php/"
      <Directory "/local/basepro/outdev/php">
        Options +ExecCGI
        SetHandler fastcgi-script
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
      </Directory>
    </IfModule>
    

    php.fcgi script :

    #!/bin/sh
    _CEE_RUNOPTS="$_CEE_RUNOPTS,HEAP(,,,FREE)"
    export _CEE_RUNOPTS
    PHP_FCGI_CHILDREN=5
    export PHP_FCGI_CHILDREN
    PHP_FCGI_MAX_REQUESTS=1000
    export PHP_FCGI_MAX_REQUESTS
    PHPRC=/local/basepro/outdev/php/php.ini
    export PHPRC
    exec /sysplex/produit/php/bin/php-cgi
    

    Kind regards

    Denis