SitePoint Sponsor

User Tag List

Page 3 of 3 FirstFirst 123
Results 51 to 69 of 69

Thread: PHP4 or PHP5

  1. #51
    SitePoint Addict jough's Avatar
    Join Date
    Sep 2001
    Location
    You have moved into a dark place. It is pitch blac
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Neither Cpanel nor Plesk use PHP to work. You can install PHP5 completely independently of either control panel and everything will work just fine.

    Now, if you're saying you can't use PHP5 because you can't install it with those control panels, then you need to learn how to install and configure PHP on your own, because the automated installations may not include all of the extensions you want or need, and it certainly isn't difficult, especially if you follow the step-by-step instructions on the PHP.net site.
    My Dynamic Site in Action:
    Poetry X Poetry Archive

  2. #52
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eric.Coleman
    php5 have everything? Not exactly.......
    Details...

    Quote Originally Posted by Eric.Coleman
    I run php5 on my in house servers, but the main production server is php4 still...
    Time for a change

  3. #53
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jough
    Neither Cpanel nor Plesk use PHP to work. You can install PHP5 completely independently of either control panel and everything will work just fine.

    Now, if you're saying you can't use PHP5 because you can't install it with those control panels, then you need to learn how to install and configure PHP on your own, because the automated installations may not include all of the extensions you want or need, and it certainly isn't difficult, especially if you follow the step-by-step instructions on the PHP.net site.
    cPanel doesn't matter

    With Plesk however, theyre is an error on their end, you need to modify php source code to get it to compile, and really, it's just a big pain in the butt..
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  4. #54
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by REMIYA
    Details...

    Time for a change
    Well... no namespaces ;P

    Secondly, I know there is pear, but im just a fan of .NET and wish there was more work put into php's SPL...
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  5. #55
    SitePoint Addict
    Join Date
    Mar 2005
    Location
    India
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sadegh
    Why are hosting companies support php5 very little ?
    May be they are waiting for a stable PHP5 release or they may be waiting for the wide acceptance of PHP5 among developers.

  6. #56
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by viv5
    [...] wide acceptance of PHP5 among developers.
    I doubt that is the problem. Most developers have accepted PHP5 very quickly, and some can't wait to be able to use it. The OO features it adds are all too attractive.

  7. #57
    SitePoint Addict jough's Avatar
    Join Date
    Sep 2001
    Location
    You have moved into a dark place. It is pitch blac
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eric.Coleman
    With Plesk however, theyre is an error on their end, you need to modify php source code to get it to compile, and really, it's just a big pain in the butt..
    Not true. You can download the latest version from a php.net mirror, untar, configure, make, make install, and you're good to go.

    Now, if Plesk has a problem with their built-in *installer* that's another story, but no one really should be using the pre-defined setup in a production server anyway, so it's not an issue.
    My Dynamic Site in Action:
    Poetry X Poetry Archive

  8. #58
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    Williamsport, PA
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP5 all the way!!! The only time I use PHP 4 anymore is when I code for an environment that I cannot control, such as my website which is hosted by a service only offering PHP 4.3.x. Perhaps its just my preference, but I think its a logical one.

    If you hadn't gone out of your way to mention that it is a large project, I wouldn't be as quick to suggest PHP 5; but in my experience PHP 5's OOP support is a far better choice for big projects than PHP 4's functional/limited OOP methodology.

  9. #59
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isn't PHP5 slower? (Due to the added OO abstractions)

  10. #60
    SitePoint Addict jough's Avatar
    Join Date
    Sep 2001
    Location
    You have moved into a dark place. It is pitch blac
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, PHP5 is faster than PHP4, even with old procedural code.

    There's really no reason not to switch. I've been researching this for a couple of months now and after changing 4 lines of code in 400,000+ lines of pre-written applications, I'm ready to go.
    My Dynamic Site in Action:
    Poetry X Poetry Archive

  11. #61
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by viv5
    May be they are waiting for a stable PHP5 release or they may be waiting for the wide acceptance of PHP5 among developers.
    There ARE stable PHP5 releases.

  12. #62
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP5 is working fine as far as I can tell. I've seen many users install my scripts which were written in php4 base using functions and they work just fine in php5. I don't see why not migrate to php5. I will as soon as my host decides to make the change.

    Doesn't mean, I'll go all-in on the OOP. I'll probably use them sparingly as I have done. So far, my design worked pretty well for me. I get asked to mod alot of other scripts too and hardly any of them are OO and if they are, they are crappy OO which I wish was written in procedural instead. Frankly crappy OO code is harder for me to decipher than crappy prodecural code. Good code on both sides is easy to understand and modify. Thats why I only use OO when necessary or when I project needs it. For a large CMS, I may go OO, for a small counter script, I just write out procedural code.

    For those of you who think its impossible to maintable a large procedural product using only functions in PHP, you are wrong. As long as you draw it out and nicely comment everything, its very easy. I could same the same with OO.

    I release scripts under GPL for people to use so anyone can understand the code. Thats why I'm against going all OO because the majority of PHP programmers can't modify OO code because they don't know how to. Using the ABC procedural I write, they can see what file acts on which one and find where to modify it, even for a beginner. It depends on your purpose on whether you write OO or not.

  13. #63
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jough
    Neither Cpanel nor Plesk use PHP to work.
    Plesk does use PHP internally , much of its functionality is PHP based rather than perl/bash based , and heres the issue , whilst plesk uses a different version of php internally than the one you use in your apache config .. a good thing.. some components (horde for instance) do not , so you had to (it may have been fixed already?) edit a couple of horde functions to work with php5 because it had some backward compatibility issues that many here suggest do not exist.

    Quote Originally Posted by php.net
    get_class_methods()

    As of PHP 5, this function returns the name of the methods as they were declared (case-sensitive). In PHP 4 they were lowercased.
    ok that could realistically be seen a a `bug-fix` , or was it a `feature not a bug` ? regardless issues exist.

    class
    $this=new $class();

    has annoyed many

    & to add insult to injury , plesk rewrites the conf.d/php.conf file whenever it feels the need ... resetting your apache PHP module back to php-4.*

    .......................................................................................

    All that aside , if you have a new project & a PHP5 host/server then you would be daft not to utilise it even if you dont immediately start `php5`ing everything, it is faster , & has (as previously mentioned) more functionality procedural or otherwise.

    e.g I love simpleXML .. though mostly because I hate XML and anything with 'DOM' in it.

    You don't need to worry immediately about the OO stuff (while Dr L's class heirarchy is still loading your efficient procedural code will be on the way to the browser ) , & dont take seriously the need to OO-JAVA-MVC everything , its mostly hype and partially flawed in the stateless environment we all work in.

    The essential beauty of PHP5 for me is that you can still mix and match your HTML with your PHP if you really want to or if its relevant to do so , you are not forced down the object-oriented highway unless thats the route you wish to follow, yet you have more than enough OO functionality (its still not nor ever should be JAVA) to confuse & delight yourself with.

  14. #64
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, even for procedural code, php5 does offer better features.

  15. #65
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats why I'm against going all OO because the majority of PHP programmers can't modify OO code because they don't know how to.
    The point of OOP, IMO, is NOT forcing anyone using the code to have to go in and modify a method or class. Good OOP allows you to easily hook or extend a new functionality w/o touching the core class. Back on subject, I have been using PHP5 since the first beta and it is by far better than 4.x. With a few exceptions, I can run most PHP4 code within my PHP5 environ.

  16. #66
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are situations like when you want to change the core functionality of the script for a specfic purpose where you have to modify the core class code, no matter how good or flexible it is and I'd have to say 60% or more of php programmers can't do that. Same thing with adding on, most PHP programmers don't know how to extend OOP and when your giving support, its alot easier to tell them how to extend procedural that teaching them the whole OOP struture.

    If your releasing alot of scripts for the public, many people are beginners and want to mod it. If you make it OOP, many of those people won't be able to. If you use functions right, its bery easy to keep a list of primary functions you use and call on them. This is easily modifiable as well as easy to explain to newbies.

  17. #67
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The whole point in "modularizing" blocks of code is maintenance and encapsulation. Having to go in to a core class or module and modify a method to change functionality is bad coding unless you are fixing a bug. Secondly, I don't care how good you docs are, to change functionality in a procedural script may require updates to multiple blocks/files/switches, especially if you haven't moved embedded HTML into templates or widget classes. I prefer to work with a good core class and hooking in any new functionality. Now granted, a OOB app may be harder to follow for a newbie or even experienced coders, but once you understand the core public methods, it is a pretty straight forward. To stick with a procedural style for the sake of hand-holding a newbie coder is not gonna result in efficient code. Sorry for the hijacking of the thread.

  18. #68
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isn't PHP5 slower? (Due to the added OO abstractions)
    Of course not, if anything it's a known fact that PHP5 is a lot faster, particularly with XML,.

    So, please no more sillyness okay?

  19. #69
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php5 is faster overall. But procedural code actually runs faster than OO in most circumstances(mainly because you have to call the class) regardless of the version. The different isn't really noticable though.


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
  •