utf problem on different PHP/APACHE?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
m0n
Forum Newbie
Posts: 2
Joined: Wed Aug 02, 2006 8:59 am

utf problem on different PHP/APACHE?

Post by m0n »

Hello Guys!

I have dev environment with IIS, PHP 4 and MySQL 5 server set with UTF8 encoding.
When i fetch data using PHP in this environment everething fine and I get utf characters displayed fine.

Then I move PHP file (which is fetching data) to another server with APACHE 2.2/PHP 5 on it. Database stays the same (located at my environment.)
BUT all characters displayed as "?" (question marks). Not even screwed up characters but really only question marks.

This makes me belive that problem is not in MySQL but probably in PHP or APACHE on second server?

I've tested fetching data on 4 servers it total. Results are (remember DB is the same):

IIS 5/PHP 4: OK;
Apache 1.3/PHP 4: OK;

Apache 2.2/PHP 5: NOT working;
Apache 2.0/PHP 4 NOT working.

Problem that webapplication will be hosted on "bad" server...

Your help will be very appreciated.
Cheers
m0n
Forum Newbie
Posts: 2
Joined: Wed Aug 02, 2006 8:59 am

Solution

Post by m0n »

Hi
I found solution:

use

Code: Select all

mysql_query("SET NAMES utf8");
right after opening connection.

I hope this helps avoid headaches as I had for 2 days
:wink:
Post Reply