Solved

Arabic Font Problem on Dedicated Server CentOS - Joomla & WordPress

Posted on 2012-03-29
5
988 Views
Last Modified: 2012-04-12
Dear All,

I need experts to solve my problem. Customer Service cannot help with such problem since they don't deal with application-based errors.

I have a dedicated server on GoDaddy, with the following:
OPERATINGSYSTEM=CentOS 5 x64
Server: Localhost via UNIX socket
Server version: 5.1.61
Protocol version: 10
MySQL charset: UTF8_general_ci
MySQL client version: 4.1.22
phpMyAdmin version: 3.4.9
Apache: 2.2.22
PHP: 5.3.10 --> GD, Gettext, Mbstring are all enabled.


I need your urgent help please.

Currently, I exhausted all possible solutions from online documentations
and discussions, suggestions, all possible solutions for such a tiny
problem with encoding, but all are unsuccessful.

Problem:
======
Any Arabic font text I enter from the client side it changes automatically
to question marks (??????).

the problem

Funny enough that when I go then to phpmyadmin
and I see the new article saved as ????? in the contents table, I edit it
manually to the Arabic text (from within phpmyadmin) and I save it, it works
successfully on my Joomla end. In other word, I can see phpMyAdmin has no problem with charset since I can manually enter Arabic text and save it. But when the Arabic text comes from client side (Joomla or WordPress), the encoding from there gets corrupted.

However, I can see the source of the problem starting when I first install Joomla I get:

MB Language is Default           No    PHP mbstring language is not set to neutral. This
can be set locally by entering*php_value mbstring.language neutral* in your
..htaccess file.

This above error of joomla installation is missing seeing the correct
language. Well, PHP has a "Constitution" file (php.ini) that can parse what
is required in the client side. Unfortunately, even when adding the
required language value, it cannot see it.

When I add the .htaccess file to the public_html directory of my domain
account, and I add the line required for MB (*php_value mbstring.language
neutral*), I get the 500 Internal Server Error. I checked the php-mbstring
and it is already installed (yum install php-mbstring).

Further, I summarise below the actions I did with no luck:

1. I made sure that the database and phpmyadmin are both in the correct
charset that supports Arabic language (UTF8).

2. I added the necessary code to the main php.ini under /etc/php.ini as
follows
[mbstring]
mbstring.language = Neutral
mbstring.internal_encoding = UTF-8
mbstring.http_input = UTF-8
mbstring.http_output = UTF-8
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = long

3. I added the following to httpd.conf file and I got the 500 Internal
Server Error:
php_value mbstring.language = Neutral ; Set default language to
Neutral(UTF-8) (default)
php_value mbstring.internal_encoding = UTF-8 ; Set default internal
encoding to UTF-8
php_value mbstring.encoding_translation = On ; HTTP input encoding
translation is enabled
php_value mbstring.http_input = auto ; Set HTTP input character set
dectection to auto
php_value mbstring.http_output = UTF-8 ; Set HTTP output encoding to UTF-8
php_value mbstring.detect_order = auto ; Set default character encoding
detection order to auto
php_value mbstring.substitute_character = none ; Do not print invalid
characters
php_value default_charset = UTF-8 ; Default character set for auto content
type header

4. I tried Joomla (1.5 and 2.5) - both same problem.

Joomla problem with MB Language
Internal Server Error (caused by adding the line to .htaccess also when I add it to httpd.conf)
5. I tried WordPress the latest version - Same problem. The ?????? appear even in the installation process when I choose an Arabic-font name for the site.

WordPress also joined the club of same problem - not only Joomla
6. I changed the charset from utf8_general_ci to UTF-8 Unicode (utf8) and to cp1256 (both bin and general_ci) ... on database and tables -- with no luck.

7. Ok then, the problem seems with PHP? Let me go and add the following to php.ini once in the main file /etc/php.ini and once in a new php.ini file I created inside cgi-bin - in either way I did restart Apache, and I did rebuild Apache with PHP, and I even restarted the server! with the same problem - as if Joomla is blind and does not want to see the default language set to Neutral!

[mbstring]
mbstring.language = Neutral
mbstring.internal_encoding = UTF-8
mbstring.http_input = UTF-8
mbstring.http_output = UTF-8
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = long;
mbstring.func_overload = 1

Then I commented the above and tried:
mbstring.language = neutral
mbstring.internal_encoding = EUC-JP
mbstring.http_input = auto
mbstring.http_output = SJIS
mbstring.encoding_translation =
mbstring.detect_order = auto
mbstring.substitute_character =
mbstring.func_overload = 0

With no Luck.

8. I tried very many tricks on Joomla Admin panel itself, changing language to Arabic, I added Arabic package and allll possible tricks. It is not relevant.


Another post on experts-exchange has discussed this problem, offered some solutions. I tried them all, with no luck. The post was (Joomla 1.5 does not show Arabic char) link: http://www.experts-exchange.com/Software/Server_Software/Content_Management/Q_23239548.html
The last comment by: wsafiPosted on 2008-05-24 at 11:25:43ID: 21639889 I tried in details with no luck.


Please help!

Many thanks in advance.

Laurance
0
Comment
Question by:laurance1
  • 3
5 Comments
 
LVL 11

Expert Comment

by:legolasthehansy
Comment Utility
Have you checked this link?

http://computerhowto.us/enable-arabic-font-in-wordpress-content.html

It seems to discuss the same problem you are having..
0
 

Author Comment

by:laurance1
Comment Utility
Thanks legolasthehansy for your reply.

I checked the link already. The guy is talking about an old problem with phpMyAdmin when the encoding was a problem. The current phpMyAdmin is more clever and it uses the default encoding of UTF-8 General or UTF-8 Unicode.

3. Change the collation become “utf8_general_ci” and save

In my case, the encoding of the database and of every single table is UTF-8 General

If you also check my post above, I tried all relevant encoding for Arabic font. It all seems fine from phpMyAdmin end. Plus, I imported the database of my old version of the my website and it has Arabic font already there and it displays it fine in Arabic.

The problem is when adding or even editing posts from Joomla (or Wordpress) end. It changes the Arabic content to ???????

Please advise!

Thanks
0
 

Accepted Solution

by:
laurance1 earned 0 total points
Comment Utility
I solved the problem by myself, not with your help, but I am happy anyway because my problem is solved now.

Technically, the solution was to change the PHP Settings within cPanel WHM and NOT from php.ini

Previously, I did change the settings from php.ini as I explained above in explaining the question.

However, cPanel WHM wouldn't accept changes coming from php.ini file (for some weird reason - don't ask me why!).

All solved with changing the section of mbstring in PHP Configuration in cPanel WHM to:

mbstring:
========
mbstring.language = Neutral
mbstring.internal_encoding = UTF-8
mbstring.http_input = UTF-8
mbstring.http_output = UTF-8
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = long;
mbstring.func_overload = 1

Make sure you hit Save when done.

I am posting the solution here to be a reference to anyone who may face this problem.

Bye
0
 

Author Closing Comment

by:laurance1
Comment Utility
Because I did NOT get any help from you, I feel I wasted my time waiting for help from you and you did not bother yourself analysing the problem with me.

I did the research and help myself - and I was kind enough to come back and post the answer for your "paid" customers to find help for similar problems.

I am not happy with your service.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now