ID: 30064 User updated by: jkawa at m dot email dot ne dot jp Reported By: jkawa at m dot email dot ne dot jp -Status: Feedback +Status: Open Bug Type: Output Control Operating System: FreeBSD 4.8-RELEASE PHP Version: 5.0.1 New Comment:
correction: Without redirection, everything (including Japanese handling) seems OK even if output_hander set to 'mb_output_handler'. reply: Without 'output_handler = mb_output_handler', all but auto code conversion works fine. Previous Comments: ------------------------------------------------------------------------ [2004-09-12 09:29:41] [EMAIL PROTECTED] Does it work for you without output_handler = mb_output_handler ? ------------------------------------------------------------------------ [2004-09-12 09:20:48] jkawa at m dot email dot ne dot jp Without redirection: $ redirect_test.php Hello, world. $ This seems OK. But in Japanese (EUC-JP), I got incorrect output. "incorrect" means something wrong, but without redirection and pipe to other, I could not look into this problem further. P.S. According to the output from phpinfo(), mbstring extension is certainly enabled. ------------------------------------------------------------------------ [2004-09-12 07:24:52] [EMAIL PROTECTED] can't reproduce it. check if mbstring module is enabled and your code outputs anything without redirection. ------------------------------------------------------------------------ [2004-09-11 23:44:05] jkawa at m dot email dot ne dot jp Description: ------------ configure options: --with-apxs --with-pgsql --enable-zend-multibyte --enable-mbstring --enable-versioning --with-pear --enable-ftp --enable-sockets diff php.ini-dist php.ini: 82a92 > ;short_open_tag = Off 86c96 < asp_tags = Off --- > asp_tags = On 89c99 < precision = 12 --- > precision = 14 101c111 < output_buffering = Off --- > output_buffering = 4096 113,115c123 < ; Note: output_handler must be empty if this is set 'On' !!!! < ; Instead you must use zlib.output_handler. < ;output_handler = --- > output_handler = mb_output_handler 121,125c129,133 < ; outputs chunks that are few hundreds bytes each as a result of < ; compression. If you prefer a larger chunk size for better < ; performance, enable output_buffering in addition. < ; Note: You need to use zlib.output_handler instead of the standard < ; output_handler, or otherwise the output will be corrupted. --- > ; outputs chunks that are few handreds bytes each as a result of compres sion. > ; If you want larger chunk size for better performence, enable output_bu ffering > ; also. > ; Note: output_handler must be empty if this is set 'On' !!!! > ; Instead you must use zlib.output_handler. 163c171 < allow_call_time_pass_reference = On --- > allow_call_time_pass_reference = Off 260c268 < ; E_STRICT - run-time notices, enable to have PHP suggest c hanges --- > ; E_STRICT - run-time notices, enable to have PHP suggest changes 280c288 < ;error_reporting = E_ALL & ~E_NOTICE --- > error_reporting = E_ALL & ~E_NOTICE 286c294 < ; - Show all errors except for notices and coding standards warnings --- > ; - Show all errors 288c296 < error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT --- > ;error_reporting = E_ALL 305c313 < log_errors = Off --- > log_errors = On 374c382 < variables_order = "EGPCS" --- > variables_order = "GPCS" 390c398 < register_long_arrays = On --- > register_long_arrays = Off 395c403 < register_argc_argv = On --- > register_argc_argv = Off 404c412 < magic_quotes_gpc = On --- > magic_quotes_gpc = Off 433a442 > include_path = ".:/usr/local/poison:/php/includes" 445c454 < ; The directory under which PHP opens the script using /~username used only --- > ; The directory under which PHP opens the script using /~usernamem used only 513,514c522,523 < ; Define the User-Agent string < ; user_agent="PHP" --- > ; Define the user agent for php to send > ;user_agent="PHP" 620c629 < ;mail.force_extra_parameters = --- > ;mail.force_extra_paramaters = 688c697 < ; SQL-Errors will be displayed. --- > ; SQL-Erros will be displayed. 752c761 < pgsql.log_notice = 0 --- > pgsql.log_notice = 1 803c812 < dbx.colnames_case = "unchanged" --- > dbx.colnames_case = "lowercase" 913c922 < session.gc_divisor = 100 --- > session.gc_divisor = 1000 919,926d927 < ; NOTE: If you are using the subdirectory option for storing session files < ; (see session.save_path above), then garbage collection does *not* < ; happen automatically. You will need to do your own garbage < ; collection through a shell script, cron entry, or some other method. < ; For example, the following script would is the equivalent of < ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): < ; cd /path/to/sessions; find -cmin +24 | xargs rm < 933c934 < session.bug_compat_42 = 1 --- > session.bug_compat_42 = 0 951c952 < ; Set to {nocache,private,public,} to determine HTTP caching aspects --- > ; Set to {nocache,private,public,} to determine HTTP caching aspects. 980c981 < session.hash_bits_per_character = 4 --- > session.hash_bits_per_character = 5 987c988 < url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" --- > url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" 1110,1111c1111,1112 < ;mbstring.language = Japanese < --- > mbstring.language = Japanese > mbstring.script_encoding = auto 1115c1116 < ;mbstring.internal_encoding = EUC-JP --- > mbstring.internal_encoding = EUC 1118c1119 < ;mbstring.http_input = auto --- > mbstring.http_input = auto 1122c1123 < ;mbstring.http_output = SJIS < ;mbstring.http_output = SJIS --- > mbstring.http_output = SJIS 1129c1130 < ;mbstring.encoding_translation = Off --- > mbstring.encoding_translation = On 1133c1134 < ;mbstring.detect_order = auto --- > ;mbstring.detect_order = SJIS-win,EUCJP-win 1185,1193d1185 < < [soap] < ; Enables or disables WSDL caching feature. < soap.wsdl_cache_enabled=1 < ; Sets the directory name where SOAP extension will put cache files. < soap.wsdl_cache_dir="/tmp" < ; (time to live) Sets the number of second while cached file will be used < ; instead of original one. < soap.wsdl_cache_ttl=86400 In this configuration, I cannot redirect any output data to a file. Flush() after print() or echo() takes no effect. Only when 'output_handler' is set to 'mb_output_handler'. Reproduce code: --------------- $ cat redirect_test.php #!/usr/local/bin/php -q <?php print "Hello, world.\n"; // flush(); ?> Expected result: ---------------- $ ./redirect_test.php > result.txt $ ls -l result.txt -rw-r--r-- 1 jkawa jkawa 14 Sep 12 06:32 result.txt $ cat result.txt Hello, world. $ Actual result: -------------- $ ls -l result.txt -rw-r--r-- 1 jkawa jkawa 0 Sep 12 06:40 result.txt $ cat result.txt $ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30064&edit=1