Apache Friends Support Forum

It is currently 21. November 2009 11:23

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: How to Run PHP files that are named in Arabic
PostPosted: 04. November 2009 09:52 
Offline

Joined: 04. November 2009 09:46
Posts: 5
Hello dears,, please I need to know if there is any way to run php files that are named not using english characters, like Arabic, there must be some module out there but I have been googling for days,,, any help please other than renaming the files !!!


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 04. November 2009 10:45 
Offline

Joined: 09. March 2008 13:04
Posts: 2186
Its not a question of PHP or Apache or Xampp, its simply a question of character sets. The character set used for the file system must support arabic characters and you should use the same character set in the Editor that you use to create the PHP Scripts.

I think utf8 should support arabic characters, there is no problem to use editors which use utf8, but I have no idea which operating system you use and if the file system supports utf8.


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 04. November 2009 13:34 
Offline

Joined: 04. November 2009 09:46
Posts: 5
I appreciate your reply, but maybe i need to give more details:
My OS is win2003, and I believe that I have Arabic supported correctly because I can successfully run such files (With Arabic Names) in case the extension was HTML, but the same file when converted to php becomes useless, like the Apache cannot find the file but with a different error:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'C:/server/www/site/عرض.php' (include_path='.;C:\php5\pear') in Unknown on line 0


NOTE: I am using utf8 encoding and you are right it supports Arabic, but after looking at the whole issue I am not sure if it is a problem of encoding.


Any ideas ??


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 04. November 2009 16:57 
Offline

Joined: 09. March 2008 13:04
Posts: 2186
How do you trigger the execution of the PHP Script?

Do you either

a) click a link in a HTML Document?
b) enter an URL in the Browser Input Line?
c) run a different PHP Script, which includes the arabic one?

It is very difficult to help as you really dont offer many informations. Never forget: we cannot see your PC, we cannot see your monitor, we dont know anything about your scripts, about your PHP, about your webserver, about your development environment. We simply see nothing and know nothing, Only the very few words you supply here.


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 05. November 2009 08:12 
Offline
AF-Moderator

Joined: 01. February 2004 12:38
Posts: 16640
Location: Stuttgart / Germany
Quote:
if there is any way to run php files that are named not using english characters, like Arabic,

No. Not directly.

If you want access such file through Apache, you can do some mod_rewrite, and map an uri with Arabic characters to a filename which PHP can access.


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 05. November 2009 08:28 
Offline

Joined: 04. November 2009 09:46
Posts: 5
Quote:
you can do some mod_rewrite, and map an uri with Arabic characters to a filename which PHP can access

I have been looking for such an answer, I don't know how to do that but now I have the correct keywords, I will try to work it out and update you with news.

Thanks,


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 05. November 2009 09:30 
Offline

Joined: 09. March 2008 13:04
Posts: 2186
Wiedmann wrote:
If you want access such file through Apache, you can do some mod_rewrite, and map an uri with Arabic characters to a filename which PHP can access.


What effectively ends up in renaming the PHP script, what he did not want:

Quote:
any help please other than renaming the files !!!


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 05. November 2009 10:04 
Offline

Joined: 04. November 2009 09:46
Posts: 5
Quote:
What effectively ends up in renaming the PHP script, what he did not want:


As I have understood I will not have to rename the PHP file, am I right, Apache will use the module to use some characters that it understands but the name I assigned will stay the same, this will work for me as it does not matter for me actually what is going inside Apache's brains.... I haven't tried it yet but I hope I didn't get it the wrong way !!


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 05. November 2009 12:52 
Offline

Joined: 09. March 2008 13:04
Posts: 2186
mh.hamad wrote:
As I have understood I will not have to rename the PHP file, am I right, Apache will use the module to use some characters that it understands but the name I assigned will stay the same, this will work for me as it does not matter for me actually what is going inside Apache's brains.... I haven't tried it yet but I hope I didn't get it the wrong way !!


Sorry, you got it wrong, sir!

It just works vice verse: you MUST rename the file at first, as PHP (obviously - I did not check that further more) cannot load files with multibyte characters (I think, that may be the reason). You can only keep the arabic names and the links in your HTML documents (if they contain arabic letters), but you have to rename the physical file and with the usage of mod_rewrite you may change the physical request from the arabic name into the (newly renamed) english name. That's what "Wiedmann" told you to do. And (if PHP really cannot load files with multibyte characters in the name) there will be no other solution.

And as you have to change the filenames anyway, I am not sure whether you need to use mod_rewrite, as I dont know if you need to "show" the physical filenames to the end-user. I cannot find any sense in using special names for PHP scripts, as these are usually hidden in links or actions etc. - usually a client does not care for filenames. So you also should change the HTML documents, i.e. the links and actions etc.


Top
 Profile  
 
 Post subject: Re: How to Run PHP files that are named in Arabic
PostPosted: 05. November 2009 14:06 
Offline

Joined: 04. November 2009 09:46
Posts: 5
I give up ...

I will rename the files to english, thank you guys for your concern ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group