Products Resources Support About Us

PHP 7 character set issues


#21

Hi

I managed to run PHP 7 in “CGI” mode, but I have an error in “FastCGI” mode that I can not solve:

[error] [client 126.32.101.80] FastCGI: incomplete headers (115 bytes) received from server “/local/basepro/m4stats/php/php.fcgi”, referer: http://tmvs:8080/

In Apache conf file I have :

CharsetSourceEnc IBM-1047
CharsetDefault ISO8859-1
AddType application/x-httpd-php .php

In the shell that runs the PHP script I have (both for CGI mode and FastCGI mode) :

export _BPXK_AUTOCVT=ON
export CGI_HEADER_ENCODING=EBCDIC
export CGI_BODY_ENCODING=EBCDIC

PHP scripts and php.ini are IBM-1047 encoded.

Thanks,

Denis


#22

Hi Denis,

Could you provide detailed description, I mean step by step?
Also could you create separated topic for your issue?

Thanks,
Tatyana


#23

Hi,

We think there is a problem in your environment, because now we are not able to reproduce this issue. I added short config, which we use in our work. Could you try to use it?

config.tar (10 KB)


#24

Thanks Tatyana, I’ll have a look and implement any differences.

When you say “we are not able to reproduce” do you mean that…

  1. Calling an external REXX via exec() from a PHP 7 CGI returns displayable characters in the output array?
  2. Posting values back to a PHP 7 CGI results in the $_POST superglobal being populated correctly?
  3. File uploads using PHP 7 result in the file being uploaded correctly and both the $_POST and $_FILES superglobals are correctly populated?

#25

Hi Tatyana,
I tried out the httpd.conf (which is http 8.5 based) you provided. I created an http 8.5 based test server for this.

As we use a directory cgi-bin I added

ScriptAlias /cgi-bin/ "/u/testhttp/server/cgi-bin/"

For PHP I added
SetEnv PHPRC /u/testhttp/server/conf

To be able to start and stop the server using MVS commands, I added:

LoadModule zos_cmds_module modules/mod_zos_cmds.so

Then I tried a shell script, a REXX script and a simple PHP script. In all cases I get EBCDIC output in Firefox.

When trying out Richard’s exec1 I get

RC=4
output[0]=�����@����������@�������@����
output[1]=
output[2]=
output[0]=hello world input one last line
output[1]=
output[2]=

Trying Richard’s testpost I also get EBCDIC garbage in Firefox.

Hm, being confused now as you said your httpd.conf did work.

– Manfred


#26

Manfred,

One more detail. PHPRC should refer to php.ini file. This setting should be set in php.ini:

cgi.fix_pathinfo=0


#27

That setting is in our php.ini.

I am pretty sure that if PHPRC points to a directory it is assumed there is a php.ini in that directory.


#28

Yes, you are right.
Which version of http server and z/OS do you use?


#29

z/os 2.1, and in this case I used http 8.5 as your httpd.conf was built for 8.5


#30

Hi Richard,

I meant all these scenarios works correctly in our system.


#31

Is there any news on this problem? I also have POST values not returned in the correct codepage.


#32

Hi,
We have to prioritize our support for paying customers. Unfortunately, PHP is not in our schedule for 2018 and half of 2019.