SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP4 or PHP5 - A Quick Question regarding hosting problem

    Hi:

    It's been a while I have searched for hosting. So, I was wondering if you could tell me whether hosting companies have updated their PHP versions or not?

    I would also ask about MySQL 5, but this is not the forum. So, I'll ask that in MySQL forum.

    I was just wondering if PHP 4 is still widely used then I should keep using it.

    THanks.
    ---------------------------
    Errors = Improved Programming.
    My Site

  2. #2
    SitePoint Addict
    Join Date
    May 2005
    Location
    London, ON
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the most part, many hosts have kept using the PHP 4.x versions for the time being. This is mostly because an upgrade to PHP 5, without lengthy notice, would cause some users websites to break.

    Many webhosts offer the upgrade on a request basis. That is, they kept PHP 4.x as a rule of thumb, but if you request to have your account upgraded its not a problem.

    I'm with Site5 by the way.
    Ryan Price
    Subscribe to my blog for regular tips and tricks

  3. #3
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.

    What do you mean "If I Request"? So, If I ask them (if available) to have PHP 5 they do it for me?

    [offtopic]
    BTW, I looked at that host. They have these BIG packages. just for $5. I don't want to start this discussion here, but how is that possible? maybe I'll ask in webhostingtalk.com
    [/offtopic]
    ---------------------------
    Errors = Improved Programming.
    My Site

  4. #4
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the most part, many hosts have kept using the PHP 4.x versions for the time being. This is mostly because an upgrade to PHP 5, without lengthy notice, would cause some users websites to break.

    Many webhosts offer the upgrade on a request basis. That is, they kept PHP 4.x as a rule of thumb, but if you request to have your account upgraded its not a problem.

    I'm with Site5 by the way.
    Absolutely.

    Most hosts are still stuck with PHP 4. However, most will happily upgrade it to version 5 if you place a request.

  5. #5
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Before you signup for an hosting account, ask them if they can upgrade to PHP 5. simple as that. Most hosting company would mention it in their company website under 'Feature' list anyway.

  6. #6
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dreamhost lets you choose between php4 or 5 on a per domain basis through their webpanel. I for one recommend them.

  7. #7
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice. Thanks.

    Just wanted to make sure I won't get stuck after creating and application with PHP5
    ---------------------------
    Errors = Improved Programming.
    My Site

  8. #8
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mudshark View Post
    Dreamhost lets you choose between php4 or 5 on a per domain basis through their webpanel. I for one recommend them.
    Same for ResellerZoom.

  9. #9
    SitePoint Guru rockit's Avatar
    Join Date
    Sep 2005
    Location
    Canada
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i've experienced some where they allow you to switch to php 5 through an .htaccess script.

  10. #10
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,161
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    version 4 - 5

    I switched to PHP version 5 a while back. I had a problem with my WP error reporting plugin because it used a function not in version 4 - date_default_timezone_get. During development it worked OK for me since I have version 5, but when a version 4 user tried the plugin it broke his blog.
    Solution? I wrapped the function calls inside function_exists ifs, this way it works in version 5 and doesn't break in version 4.
    So I guess as long as you provide backwards compatability this way, you could code away using version 5 functions.
    Quote Originally Posted by Jeanco
    an upgrade to PHP 5, without lengthy notice, would cause some users websites to break.
    @Jeanco Do you know where I can find info on deprecated not-supported version 4 functions. I've noticed that function docs have a "since version" line, and I know some say "deprecated", but I've never noticed "no longer supported" for any of them. (not that they aren't there )

  11. #11
    SitePoint Addict
    Join Date
    May 2005
    Location
    London, ON
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you set your error reporting level to E_STRICT you will receive a warning whenever you use a deprecated function.

    I think this would be the easiest way to check what functions are older... just turn it on once to get the warnings, then take care of the backwards compatibility for those functions, turn it off and continue coding.

    http://ca3.php.net/error-reporting

    Hope it helps.
    Ryan Price
    Subscribe to my blog for regular tips and tricks

  12. #12
    SitePoint Addict
    Join Date
    May 2005
    Location
    London, ON
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wait sorry I had that wrong. That will tell you when you're using deprecated functions - not when you're using new ones.

    I'm trying to track down the list of new functions now.
    Ryan Price
    Subscribe to my blog for regular tips and tricks

  13. #13
    SitePoint Addict
    Join Date
    May 2005
    Location
    London, ON
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay here we go:

    http://livedocs.coggeshall.org/en/migration5.html

    That site lists all the new functions in PHP 5, as well as listing any functions that are in both 4 and 5, but operate differently between the two versions.

    That should do the trick
    Ryan Price
    Subscribe to my blog for regular tips and tricks

  14. #14
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,161
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    deprecated

    Thanks for posting the link, a great resource
    A while back I started using a custom error handler on my site that logs any and all errors. It was a really humbling experience and it took a while to clean up the STRICT errors, but it's comforting to know the code will be OK if I go back to version 4 (not likely, but who knows?), and I'm sure I'll be going back to the coggeshall site the more I get into OOP.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •