icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » Shared Hosting » Questions on PHP version and language

Shared Hosting Questions about your shared hosting account.

Reply
 
LinkBack Thread Tools Search this Thread
Old December 20th, 2007, 3:39 PM   #1 (permalink)
Registered User
Fresh Surpasser
 
Joined in Dec 2007
Hosted on Bacon
19 posts
Gave thanks: 2
Thanked 0 times
Questions on PHP version and language

I have a few questions...

1. PHP 4 and 5 are supported. I can see an area in CPanel where I can choose to have PHP files parsed as PHP5. There is also the system default option. What is this system default?

2. Is it possible to have .php4 files parsed as PHP4 and .php files as PHP5? Or .php5 as PHP5 and .php as PHP4?

3. If I just have everything parsed as PHP5, will my PHP4 scripts still work? Or are there too many changes to use PHP4 safely?

4. This one is unrelated to the above... I just tried using my CPanel file manager to create a file. I used the built-in code editor. When I saved it, the file looked like it was corrupted. All the characters were converted into HTML entities. Then it gave me a link to change my CPanel language to UTF-8. What is this? Why does this happen?
If I use the regular text editor, the file saves properly...

Thanks!
__________________
PBBG Blog
Server: Bacon
Zeggy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 20th, 2007, 3:48 PM   #2 (permalink)
URB4N 5K1LLZ
Super #1
 
Roxy's Avatar
 
Joined in Sep 2005
Lives in Orlando, FL
Hosted on SH63
2,660 posts
Gave thanks: 81
Thanked 128 times
For your first three questions I cannot answer, but for your last:

I would suggest not using the cpanel to edit your files, use a program on your computer for this. UTF-8 is a script/program/scanner (I'm not sure what you would call it) that reads certain characters in an HTML/PHP file. Why it happend I am not too sure since I have never used Cpanel for editing my files, but I have seen it when placing a DOC code in my HTML files.

EDIT/// THANK YOU NEIL!

"UCS and Unicode are first of all just code tables that assign integer numbers to characters. There exist several alternatives for how a sequence of such characters or their respective integer values can be represented as a sequence of bytes. The two most obvious encodings store Unicode text as sequences of either 2 or 4 bytes sequences. The official terms for these encodings are UCS-2 and UCS-4, respectively. Unless otherwise specified, the most significant byte comes first in these (Bigendian convention). An ASCII or Latin-1 file can be transformed into a UCS-2 file by simply inserting a 0x00 byte in front of every ASCII byte. If we want to have a UCS-4 file, we have to insert three 0x00 bytes instead before every ASCII byte.

Using UCS-2 (or UCS-4) under Unix would lead to very severe problems. Strings with these encodings can contain as parts of many wide characters bytes like “\0” or “/” which have a special meaning in filenames and other C library function parameters. In addition, the majority of UNIX tools expects ASCII files and cannot read 16-bit words as characters without major modifications. For these reasons, UCS-2 is not a suitable external encoding of Unicode in filenames, text files, environment variables, etc.

The UTF-8 encoding defined in ISO 10646-1:2000 Annex D and also described in RFC 3629 as well as section 3.9 of the Unicode 4.0 standard does not have these problems. It is clearly the way to go for using Unicode under Unix-style operating systems. "

From: http://www.cl.cam.ac.uk/~mgk25/unicode.html#unicode

My explanation was horrible. =(
__________________
Roxanne


Urban Roxy -Personal Blog
SH63 - the best darn shared server!
Roxy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks Roxy for this great post!
Kayla (December 20th, 2007)
Old December 20th, 2007, 4:27 PM   #3 (permalink)
Surpass Fan
On a golden path...
 
Neil's Avatar
 
Joined in Oct 2004
Lives in UK
359 posts
Gave thanks: 6
Thanked 13 times
If you end up curious then though it may not look it at first, it is a pretty simple explanation... ftp://ftp.ilog.fr/pub/Users/haible/u...O-1.html#ss1.1 ....honest.
__________________
D17/D21/P59/P62/VPSX - "Faith can move mountains" (Faiths a big girl....) - I'm not paranoid, I know they are out to get me!
Neil is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks Neil for this great post!
Kayla (December 20th, 2007)
Old December 20th, 2007, 5:07 PM   #4 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,079 posts
Gave thanks: 48
Thanked 131 times
1. I believe the default is PHP4. You'll need to confirm with support on this.
2. Yes, that can be configured through .htaccess configuration.
3. Depends on how you coded your scripts... When I still worked with PHP, almost all of my scripts coded for PHP4 worked flawlessly with PHP5.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks H for this great post!
Kayla (December 20th, 2007)
Old December 21st, 2007, 11:02 AM   #5 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,222 posts
Gave thanks: 18
Thanked 86 times
I've configured my site to process all .php file using PHP5 and all .php4 files to use PHP4. The default configuration is indeed for PHP4 to handle .PHP files and PHP5 to handle .PHP5 files. It's just a matter of changing your .htaccess file (which I am unable to access from work or I would post it).

All of my PHP4 scripts work fine in PHP5; however, I do have some scripts that work with PHP5 that do not with PHP4 (mainly my XML parsing scripts if memory serves, that and Gallery2 is moving towards only working with PHP5. Gallery 2.4 will require PHP 5.2 or greater to work properly when it comes out.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 21st, 2007, 10:57 PM   #6 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,222 posts
Gave thanks: 18
Thanked 86 times
Okay, here's how you make the change:
Code:
AddHandler application/x-httpd-php5 .php
AddHandler application/x-httpd-php .php4
Hope that helps.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks MarkRH for this great post!
Zeggy (January 6th, 2008)
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On