Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Jeremy Chadwick
The problem you're describing sounds more like a combination of browser
bugs, more than anything.  I have seen instances of both Firefox and IE
both caching Content-Types of web pages on occasion.  Thankfully Firefox
behaves significantly better, and has the "View Page Info" option, which
will tell you what encoding all of the data is being rendered as.

Secondly:

suPHP does not understand php_admin_flag.  If your Apache server starts
and doesn't complain about php_admin_flag being an unknown command, you
have mod_php[45].so loaded somewhere in your Apache config.

Thirdly, regarding locales:

If you want web pages displayed in certain character sets, you should be
specifying that character set in the HTML output using the Content-Type
equiv, e.g.:



This doesn't have anything with iconv or mbstring.  Those are for string
manipulation functions and collation (conversion between one charset and
another).

Bottom line: if you want to use utf-8 (good for you!  I salute you), you
need to use it from the very start.  If any data that PHP script has
stored in the past *was not* using utf-8, then you're going to have
collated data, and it's a real pain to deal with.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

On Mon, Jun 30, 2008 at 11:39:18AM +0200, oxy wrote:
> hi!
> 
> I am new in using suphp and need some help.
> System is  FreeBSD 7.0+apache 2.2.9+php 5.2.6+suphp 0.6.3
> I have a couple hundred vhosts (hungarian language) and my problem is 
> the following:
> I use php_admin_flag on some vhost in order to see hungarian accent:
> php_admin_flag iconv.input_encoding UTF-8
> php_admin_flag iconv.internal_encoding UTF-8
> php_admin_flag iconv.output_encoding UTF-8
> php_admin_flag mbstring.internal_encoding UTF-8
> 
> When I enable suphp these web pages' accent are wrong with firefox,
> however it is OK with IE.. after disabling suphp the accent is good with
> both browsers..
> Don't really know that the problem is that apache do not use my 
> php_admin_flags or
> something else..
> (php5 module is loaded in apache in order to use these php_admin_flags)
> 
> thanks for your help in advance!
> 
> 
> ___
> suPHP mailing list
> suPHP@lists.marsching.biz
> http://lists.marsching.com/mailman/listinfo/suphp

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Alessandro De Zorzi
oxy wrote:
> When I enable suphp these web pages' accent are wrong with firefox,
> however it is OK with IE.. after disabling suphp the accent is good with
> both browsers..
> Don't really know that the problem is that apache do not use my 
> php_admin_flags or
> something else..
> (php5 module is loaded in apache in order to use these php_admin_flags)
>   
You could use AddDefaultCharset in Virtual definition because as you can
see in FAQ section
[...suPHP does not support the php_value/php_admin_value directive...]


AddDefaultCharset utf-8


Alessandro

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread oxy
thanks for the tipp, i tried it, but didn't helped.
it seems it's already using utf-8


Alessandro De Zorzi írta:
> oxy wrote:
>   
>> When I enable suphp these web pages' accent are wrong with firefox,
>> however it is OK with IE.. after disabling suphp the accent is good with
>> both browsers..
>> Don't really know that the problem is that apache do not use my 
>> php_admin_flags or
>> something else..
>> (php5 module is loaded in apache in order to use these php_admin_flags)
>>   
>> 
> You could use AddDefaultCharset in Virtual definition because as you can
> see in FAQ section
> [...suPHP does not support the php_value/php_admin_value directive...]
>
> 
> AddDefaultCharset utf-8
> 
>
> Alessandro
>
> ___
> suPHP mailing list
> suPHP@lists.marsching.biz
> http://lists.marsching.com/mailman/listinfo/suphp
>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread oxy
Thank you for your answer,
first : in firefox View Page Info shows that




so php_admin_flags are used (yes, as mentioned I enabled mod_php5)

however the accents are not good with firefox when suphp is enabled and 
I can't really
see the connection between suphp and accents..(when suphp is disabled 
the charset is utf-8 too
and it works flawlessly with both browsers)

note to the bottom line: it's not really my choice to use utf8 or not, i 
have to make it work, nothin' more
because of it's workin' fine with disabled suphp i can't say that there 
is any problem with the php page,
but it was not me who coded the page.


Jeremy Chadwick írta:
> The problem you're describing sounds more like a combination of browser
> bugs, more than anything.  I have seen instances of both Firefox and IE
> both caching Content-Types of web pages on occasion.  Thankfully Firefox
> behaves significantly better, and has the "View Page Info" option, which
> will tell you what encoding all of the data is being rendered as.
>
> Secondly:
>
> suPHP does not understand php_admin_flag.  If your Apache server starts
> and doesn't complain about php_admin_flag being an unknown command, you
> have mod_php[45].so loaded somewhere in your Apache config.
>
> Thirdly, regarding locales:
>
> If you want web pages displayed in certain character sets, you should be
> specifying that character set in the HTML output using the Content-Type
> equiv, e.g.:
>
> 
>
> This doesn't have anything with iconv or mbstring.  Those are for string
> manipulation functions and collation (conversion between one charset and
> another).
>
> Bottom line: if you want to use utf-8 (good for you!  I salute you), you
> need to use it from the very start.  If any data that PHP script has
> stored in the past *was not* using utf-8, then you're going to have
> collated data, and it's a real pain to deal with.
>
>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Jeremy Chadwick
No.  You're not understanding.

 is in the HTML code of the document being returned from
PHP.

AddDefaultCharset will induce an HTTP header, which ***is not*** in the
HTML.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

On Mon, Jun 30, 2008 at 12:27:34PM +0200, oxy wrote:
> thanks for the tipp, i tried it, but didn't helped.
> it seems it's already using utf-8
> 
> 
> Alessandro De Zorzi írta:
> > oxy wrote:
> >   
> >> When I enable suphp these web pages' accent are wrong with firefox,
> >> however it is OK with IE.. after disabling suphp the accent is good with
> >> both browsers..
> >> Don't really know that the problem is that apache do not use my 
> >> php_admin_flags or
> >> something else..
> >> (php5 module is loaded in apache in order to use these php_admin_flags)
> >>   
> >> 
> > You could use AddDefaultCharset in Virtual definition because as you can
> > see in FAQ section
> > [...suPHP does not support the php_value/php_admin_value directive...]
> >
> > 
> > AddDefaultCharset utf-8
> > 
> >
> > Alessandro
> >
> > ___
> > suPHP mailing list
> > suPHP@lists.marsching.biz
> > http://lists.marsching.com/mailman/listinfo/suphp
> >   
> 
> ___
> suPHP mailing list
> suPHP@lists.marsching.biz
> http://lists.marsching.com/mailman/listinfo/suphp

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread oxy
sorry, i misunderstood..
anyway, AddDefaultCharset did not helpet in this case

Jeremy Chadwick írta:
> No.  You're not understanding.
>
>  is in the HTML code of the document being returned from
> PHP.
>
> AddDefaultCharset will induce an HTTP header, which ***is not*** in the
> HTML.
>
>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Jeremy Chadwick
Okay, but you've stated in another portion of this mail thread that
you're using mod_php5, which means suPHP isn't involved/responsible
for the problems you're reporting here.

Am I misunderstanding?

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

On Mon, Jun 30, 2008 at 01:07:22PM +0200, oxy wrote:
> sorry, i misunderstood..
> anyway, AddDefaultCharset did not helpet in this case
>
> Jeremy Chadwick írta:
>> No.  You're not understanding.
>>
>>  is in the HTML code of the document being returned from
>> PHP.
>>
>> AddDefaultCharset will induce an HTTP header, which ***is not*** in the
>> HTML.
>>
>>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Alessandro De Zorzi
oxy wrote:
> thanks for the tipp, i tried it, but didn't helped.
> it seems it's already using utf-8
> 
>   
a useful tool http://web-sniffer.net/
could help to you to check some mistakes

Alessandro


___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Jeremy Chadwick
Yes, I am misunderstanding.  My apologies.

A couple ideas.  NONE of these are guarantees.

1) Upon suPHP forking a process (to launch the PHP interpreter), some
environment variables pertaining to locale (e.g. LC_CTYPE, LC_ALL, etc.)
are being pulled in from somewhere.  Could be a system login
configuration thing; I also forget if suPHP uses system() or execle().
If the lesser, it could be a system-wide profile, cshrc, or bashrc
thing.

2) It could be an environment variable setting that's being induced as a
result of spawning httpd.  E.g. sudo, /etc/init.d/apache start, which
might cause a the shell that launched httpd to include any locale
environment settings you use on your account under the Apache server.
FreeBSD has some workarounds for this problem, not sure about Linux.

An idea to rule out environment issues: compare the output from
phpinfo() under mod_php5 to phpinfo() under suPHP.  There might be some
piece of the puzzle revealed.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

On Mon, Jun 30, 2008 at 04:09:10AM -0700, Jeremy Chadwick wrote:
> Okay, but you've stated in another portion of this mail thread that
> you're using mod_php5, which means suPHP isn't involved/responsible
> for the problems you're reporting here.
> 
> Am I misunderstanding?
> 
> -- 
> | Jeremy Chadwickjdc at parodius.com |
> | Parodius Networking   http://www.parodius.com/ |
> | UNIX Systems Administrator  Mountain View, CA, USA |
> | Making life hard for others since 1977.  PGP: 4BD6C0CB |
> 
> On Mon, Jun 30, 2008 at 01:07:22PM +0200, oxy wrote:
> > sorry, i misunderstood..
> > anyway, AddDefaultCharset did not helpet in this case
> >
> > Jeremy Chadwick írta:
> >> No.  You're not understanding.
> >>
> >>  is in the HTML code of the document being returned from
> >> PHP.
> >>
> >> AddDefaultCharset will induce an HTTP header, which ***is not*** in the
> >> HTML.
> >>
> >>   
> 
> ___
> suPHP mailing list
> suPHP@lists.marsching.biz
> http://lists.marsching.com/mailman/listinfo/suphp

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread oxy
Here are the relevant lines in httpd.conf:

LoadModule php5_modulelibexec/apache22/libphp5.so
LoadModule suphp_module   libexec/apache22/mod_suphp.so
suPHP_Engine On
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
suPHP_AddHandler application/x-httpd-php

when i switch suPHP_Engine to Off my accent problems are gone..
I think suPHP is involved, but not sure it's responsible.
Just dunno where to start and how to fix

Jeremy Chadwick írta:
> Okay, but you've stated in another portion of this mail thread that
> you're using mod_php5, which means suPHP isn't involved/responsible
> for the problems you're reporting here.
>
> Am I misunderstanding?
>
>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread oxy

thanks, i'll try phpinfo() shortly with both ways..
the first thing might not be a problem, i only need utf-8 for a couple 
vhosts, not for all.
the second thing: i am using fbsd 7.0.
i will report shortly what phpinfo() showed

Jeremy Chadwick írta:
> Yes, I am misunderstanding.  My apologies.
>
> A couple ideas.  NONE of these are guarantees.
>
> 1) Upon suPHP forking a process (to launch the PHP interpreter), some
> environment variables pertaining to locale (e.g. LC_CTYPE, LC_ALL, etc.)
> are being pulled in from somewhere.  Could be a system login
> configuration thing; I also forget if suPHP uses system() or execle().
> If the lesser, it could be a system-wide profile, cshrc, or bashrc
> thing.
>
> 2) It could be an environment variable setting that's being induced as a
> result of spawning httpd.  E.g. sudo, /etc/init.d/apache start, which
> might cause a the shell that launched httpd to include any locale
> environment settings you use on your account under the Apache server.
> FreeBSD has some workarounds for this problem, not sure about Linux.
>
> An idea to rule out environment issues: compare the output from
> phpinfo() under mod_php5 to phpinfo() under suPHP.  There might be some
> piece of the puzzle revealed.
>
>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread oxy
when is switch suphp_engine on web-sniffer says (user agent web-sniffer):
Transfer-Encoding:chunked
Content-Type:text/html; charset=iso-8859-2

So with suphp the charset is not utf-8..

switching suphp_engine off says:
text/html; charset=0


Alessandro De Zorzi írta:
> oxy wrote:
>   
>> thanks for the tipp, i tried it, but didn't helped.
>> it seems it's already using utf-8
>> 
>>   
>> 
> a useful tool http://web-sniffer.net/
> could help to you to check some mistakes
>
> Alessandro
>
>
> ___
> suPHP mailing list
> suPHP@lists.marsching.biz
> http://lists.marsching.com/mailman/listinfo/suphp
>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Jeremy Chadwick
I maintain the suPHP port under FreeBSD, but not the PHP port under
FreeBSD, so this concerns me greatly.

We use suPHP here for our hosting without any of these issues, and we
have some users who exclusively use utf-8 as well as shift_jis for their
encoding types.  I haven't received any reports of problems from our
users.

Regarding environment variables on FreeBSD:

/usr/local/sbin/envvars is run upon startup of Apache (assuming you are
launching it through /usr/local/etc/rc.d/apache22), which can set or
override environment variables placed sh commands within
/usr/local/etc/apache22/envvars.d.

If you're using sudo, I've found that I have to "exclude" a bunch of
environment variables passed into the sub (root) shell when using sudo
-i.  This problem was introduced in sudo 1.6.9, as the authors made many
changes to env_keep variables...

Just food for thought.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

On Mon, Jun 30, 2008 at 01:19:30PM +0200, oxy wrote:
>
> thanks, i'll try phpinfo() shortly with both ways..
> the first thing might not be a problem, i only need utf-8 for a couple  
> vhosts, not for all.
> the second thing: i am using fbsd 7.0.
> i will report shortly what phpinfo() showed
>
> Jeremy Chadwick írta:
>> Yes, I am misunderstanding.  My apologies.
>>
>> A couple ideas.  NONE of these are guarantees.
>>
>> 1) Upon suPHP forking a process (to launch the PHP interpreter), some
>> environment variables pertaining to locale (e.g. LC_CTYPE, LC_ALL, etc.)
>> are being pulled in from somewhere.  Could be a system login
>> configuration thing; I also forget if suPHP uses system() or execle().
>> If the lesser, it could be a system-wide profile, cshrc, or bashrc
>> thing.
>>
>> 2) It could be an environment variable setting that's being induced as a
>> result of spawning httpd.  E.g. sudo, /etc/init.d/apache start, which
>> might cause a the shell that launched httpd to include any locale
>> environment settings you use on your account under the Apache server.
>> FreeBSD has some workarounds for this problem, not sure about Linux.
>>
>> An idea to rule out environment issues: compare the output from
>> phpinfo() under mod_php5 to phpinfo() under suPHP.  There might be some
>> piece of the puzzle revealed.
>>
>>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Jeremy Chadwick
Do you have mime_magic_module enabled in Apache?

Also, "charset=0" is wrong.  I don't know what Apache or mod_php5 is
doing to induce that, but it's broken.

Finally, Transfer-Encoding has nothing to do with this problem.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

On Mon, Jun 30, 2008 at 01:25:52PM +0200, oxy wrote:
> when is switch suphp_engine on web-sniffer says (user agent web-sniffer):
> Transfer-Encoding:chunked
> Content-Type:text/html; charset=iso-8859-2
> 
> So with suphp the charset is not utf-8..
> 
> switching suphp_engine off says:
> text/html; charset=0
> 
> 
> Alessandro De Zorzi írta:
> > oxy wrote:
> >   
> >> thanks for the tipp, i tried it, but didn't helped.
> >> it seems it's already using utf-8
> >> 
> >>   
> >> 
> > a useful tool http://web-sniffer.net/
> > could help to you to check some mistakes
> >
> > Alessandro
> >
> >
> > ___
> > suPHP mailing list
> > suPHP@lists.marsching.biz
> > http://lists.marsching.com/mailman/listinfo/suphp
> >   
> 
> ___
> suPHP mailing list
> suPHP@lists.marsching.biz
> http://lists.marsching.com/mailman/listinfo/suphp

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread oxy
yes, mime_magic_module is enabled

Jeremy Chadwick írta:
> Do you have mime_magic_module enabled in Apache?
>
> Also, "charset=0" is wrong.  I don't know what Apache or mod_php5 is
> doing to induce that, but it's broken.
>
> Finally, Transfer-Encoding has nothing to do with this problem.
>
>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread oxy
yes, i start apache from rc.d, nincs directly with apachectl
not using sudo and envvars.d directory is empty

Jeremy Chadwick írta:
> I maintain the suPHP port under FreeBSD, but not the PHP port under
> FreeBSD, so this concerns me greatly.
>
> We use suPHP here for our hosting without any of these issues, and we
> have some users who exclusively use utf-8 as well as shift_jis for their
> encoding types.  I haven't received any reports of problems from our
> users.
>
> Regarding environment variables on FreeBSD:
>
> /usr/local/sbin/envvars is run upon startup of Apache (assuming you are
> launching it through /usr/local/etc/rc.d/apache22), which can set or
> override environment variables placed sh commands within
> /usr/local/etc/apache22/envvars.d.
>
> If you're using sudo, I've found that I have to "exclude" a bunch of
> environment variables passed into the sub (root) shell when using sudo
> -i.  This problem was introduced in sudo 1.6.9, as the authors made many
> changes to env_keep variables...
>
> Just food for thought.
>
>   

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp


Re: [suPHP] suphp and utf-8 problem

2008-06-30 Thread Jeremy Chadwick
Sorry, I forgot to CC the list on this.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

- Forwarded message from Jeremy Chadwick <[EMAIL PROTECTED]> -

> From: Jeremy Chadwick <[EMAIL PROTECTED]>
> To: oxy <[EMAIL PROTECTED]>
> Date: Mon, 30 Jun 2008 05:14:58 -0700
> Subject: Re: [suPHP] suphp and utf-8 problem
> 
> Does disabling it change anything for you?  I'm betting it won't, but I
> thought I'd ask anyways.
> 
> As far as I know, the character set set via the HTTP Content-Type header
> is controlled by the PHP script itself, and not from suPHP or mod_php5.
> 
> Here's an example:
> 
>echo "hello\n";
> ?>
> 
> Results in these headers and content:
> 
> $ curl -i -s -S http://jdc.parodius.com/test.php
> HTTP/1.1 200 OK
> Date: Mon, 30 Jun 2008 12:11:49 GMT
> Server: Apache
> X-Powered-By: PHP/5.2.6
> Transfer-Encoding: chunked
> Content-Type: text/html
> 
> hello
> 
> 
> While this PHP script:
> 
>header("Content-Type: text/html; charset=iso-8859-1");
>   echo "hello\n";
> ?>
> 
> Results in:
> 
> $ curl -i -s -S http://jdc.parodius.com/test.php
> HTTP/1.1 200 OK
> Date: Mon, 30 Jun 2008 12:13:00 GMT
> Server: Apache
> X-Powered-By: PHP/5.2.6
> Transfer-Encoding: chunked
> Content-Type: text/html; charset=iso-8859-1
> 
> hello
> 
> 
> -- 
> | Jeremy Chadwickjdc at parodius.com |
> | Parodius Networking   http://www.parodius.com/ |
> | UNIX Systems Administrator  Mountain View, CA, USA |
> | Making life hard for others since 1977.  PGP: 4BD6C0CB |
> 
> On Mon, Jun 30, 2008 at 01:58:59PM +0200, oxy wrote:
> > yes, mime_magic_module is enabled
> >
> > Jeremy Chadwick írta:
> >> Do you have mime_magic_module enabled in Apache?
> >>
> >> Also, "charset=0" is wrong.  I don't know what Apache or mod_php5 is
> >> doing to induce that, but it's broken.
> >>
> >> Finally, Transfer-Encoding has nothing to do with this problem.
> >>
> >>   

- End forwarded message -

___
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp