1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Possible to have php v5.4 for one site and 5.3 for rest?

Discussion in 'PHP' started by Mkcoy, Apr 18, 2015.

  1. #1
    On my server i have multi php installed.

    Is it possible and if so do you know how to setup 5.4 on just one site and leave the others as 5.3? Cpanel.

    Thanks!
     
    Mkcoy, Apr 18, 2015 IP
  2. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #2
    Why?
     
    NetStar, Apr 18, 2015 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #3
    Possible? I suppose so much like making PHP 4.x run alongside 5.x, but @NetStar asks a damned good question: WHY?

    If anything you have isn't working in 5.4 but works in 5.3, you need to go in and fix the bloody program throwing the errors, not leave outdated code and broken methodologies in place and sleaze along with an older version that may have vulnerabilities. Between 5.3 and 5.4 the only major changes that may effect things is the removal of a few redundant alias' for functions that now throw warnings... for the most part 5.4 is about new features, not so much getting rid of anything that's a "must have" from older versions.

    Check the incompatibilities list:
    http://php.net/manual/en/migration54.incompatible.php

    Most of it - like magicquotes going the way of the dodo, the utterly inept and completely incorrectly named "safe mode', register globals -- these are all things that we've been told for a DECADE to stop using and if your code relies on them, you are running the risk of security holes and need to toss the code and start over!

    NOT that people want to hear or are even willing to listen to "toss it and start over" or "You're doing it all wrong" even when it's the truth. See why we still have halfwits, morons and fools vomiting up code that still uses the mysql_ functions or on the HTML side people still using iframe, target, and putting STYLE in the markup.

    But really, if migrating from 5.3 to 5.4 breaks anything, your code is probably doing something wrong/insecure and NEEDS to be fixed.
     
    deathshadow, Apr 19, 2015 IP
    malky66 likes this.
  4. Mkcoy

    Mkcoy Well-Known Member

    Messages:
    1,602
    Likes Received:
    77
    Best Answers:
    2
    Trophy Points:
    195
    #4
    Why is irrelevant... But its because we are using a script that requires 5.4 but all the other scripts on that server don't work with 5.4 and it breaks them.

    So we just wanted to know how to do it. We're not all uber 4 eyed geeks!

    All this waffle to make it look like you know what you're talking about but basically, you don't really know.

    It's a simple bloody question. You either know how to do it you don't.
     
    Mkcoy, Apr 19, 2015 IP
    ThePHPMaster likes this.
  5. billzo

    billzo Well-Known Member

    Messages:
    961
    Likes Received:
    278
    Best Answers:
    15
    Trophy Points:
    113
    #5
    Yes, it is possible with cPanel to have multiple PHP versions and be able to choose which one you want to use with each domain. Does your cPanel have a PHP Selector in the Software and Services section of the cPanel main page? For your main domain and each add-on domain you have a drop-down box where you can specify which PHP version you want to use (assuming your host offers 5.3). So you can have one or more sites running PHP 5.4 and others running 5.3 (if it is offered as some hosts still have 5.3).

    The point that others are making with PHP 5.3 is that it is end of life now, is no longer being supported (though I assume that security patches will be back-ported into 5.3 as CentOS likes to do), and you will eventually have to update your code to use newer versions of PHP, so you might as well do it now. It should not be that hard. The link provided about the incompatibilities between 5.3 and 5.4 is a great place to start.
     
    billzo, Apr 19, 2015 IP
    deathshadow likes this.
  6. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #6
    @Mkcoy the point @deathshadow make is a very good point - nothing in PHP 5.4 should break "everything" as you say it does - if it does, then you have major problems with the code, and you should do a code-review ASAP - simply because you risk exposing a lot more than you want if someone shows up and try to use these code-problems to their advantage - I'm not saying there's necessarily any security risk present, but it might very well be, and you should probably check it out the sooner the better.
     
    PoPSiCLe, Apr 19, 2015 IP
    deathshadow and malky66 like this.
  7. ezfile

    ezfile Greenhorn Affiliate Manager

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #7
    Yes it is possible, if you are using nginx you can specify one site to use one version of php (running as php-fpm lets say on port 10001) and have another site use a different version of php running as php-fpm listening on port 10002
    Or can use socket files instead.
     
    ezfile, Apr 20, 2015 IP
  8. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
  9. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #9
    You took it the wrong way. "Why" is very relevant because it may not be necessary to run two versions of php. That's why the question "why?" Was asked and is relevant. In your case you have a script that is "breaking" due to what you believe is lack of support in a slightly newer version of php? Well.....what is the error? That should be the start rather than wasting time to install two versions of php which may be unnecessary. But since you are a douche..........have fun
     
    NetStar, Apr 20, 2015 IP
    malky66 likes this.
  10. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #10
    That's the real thing of it, 5.3 to 5.4 should be a non-issue; again that list of incompatibilities I linked to shouldn't be a big deal to fix, and to be brutally frank a LOT of it is stuff that should have been removed from PHP in 5.0 or never introduced in the first place.

    I mean, I could see 5.6/later as the incompatibilities increase greatly at that point, but 5.3 to 5.4 "Breaks them"? That's some jacktarded nonsense right there unless we're talking the pinnacle of developer ineptitude.

    .. and even then the small list of incompatibilities:
    http://php.net/manual/en/migration56.php
    http://php.net/manual/en/migration55.php
    http://php.net/manual/en/migration54.php

    ... and deprecated features:
    http://php.net/manual/en/migration56.deprecated.php
    http://php.net/manual/en/migration55.deprecated.php
    http://php.net/manual/en/migration54.deprecated.php

    Should NOT be a deal breaker unless you are sleazing along with DECADE out of date code like the stupid malfing insecure by design mysql_ functions that were deprecated in 5.5 TWO YEARS AGO -- and the MOST that does for the time being is fill your error log with "Hey dipshit, we've been telling you for NINE YEARS to stop using those!"

    Though when the latest STABLE is 5.6.8, one has to wonder why we're talking 5.3 or 5.4, but hey... that's a good chunk of why I think a lot of people shouldn't be allowed to run websites or hosting in the first place.
     
    Last edited: Apr 20, 2015
    deathshadow, Apr 20, 2015 IP
    NetStar likes this.
  11. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #11
    Granted, this is often because the official repo's aren't updated to latest - unless you want to compile stuff yourself, and have no-one to answer to, updating to a non-supported version on a production server would usually end in a severe verbal trashing, possible termination. Running a couple versions behind isn't really unusual - although quite a few of the "no we can't do this, this and that will break"-people need to just get on with it - stop keeping backwards compatibility all the time - if PHP decided to just remove all former versions, stop support, just "this is the new version, USE IT" I think quite a bit of the lag would disappear. Same if more hosting companies just went "oh, sorry, your code is for an outdated version, and we will not allow it"
     
    PoPSiCLe, Apr 21, 2015 IP
  12. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #12
    You would think more hosting companies would do that as it's a security risk for THEM. PARTICULARLY on shared hosting.

    But they'd rather run the risk and allow users to run any buggy crap they want, rather than risk alienating people who can't be bothered to have a realistic update schedule. There's this noodle-doodle idea people have that web software can simply be written once and be left alone forever -- thanks to the sleazeball crackers and other nefarious mustache twirling villains tying girls to train tracks, that's more of an ideal than fact.

    Much less SO much of the stuff out there right now is NOT written by people who know enough about the underlying technologies to be doing so -- and worse blindly relying on the efforts of others. You look at the front-end output of so many systems and that's plainly obvious as it's all the bleeding edge of 1997 practices -- under the hood it's much the same given how much crap out there STILL hasn't migrated away from mysql_ functions?
     
    deathshadow, Apr 21, 2015 IP
  13. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #13
    Yeah - That's why I like my Norwegian host (shared) - they basically quarantine anything not passing their code-review (they have that at random intervals during the year) - they haven't gone past PHP 5.5, and still run quite a few instances on 5.4, but I can live with that.
     
    PoPSiCLe, Apr 21, 2015 IP
  14. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #14
    It *is* possible, but the amount of effort required to do so really would be better spent fixing the issues on old scripts that require old versions of PHP. The changes between 5.3 and 5.4 weren't super great. 5.4 removed things that really should not be used anyway (like magic quotes).

    At this point, 5.3 doesn't even get security fixes, and even security fixes for 5.4 is ending soon.

    http://php.net/supported-versions.php
     
    digitalpoint, Apr 21, 2015 IP
  15. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #15
    The original poster is the same clown that believes his bought Email List will make him thousands of dollars via spamming... he has no idea what works and what doesn't. There's a great chance both of his scripts work fine in both versions of PHP. He's either misinterpreting the error or it's 100% user error. Unfortunately he doesn't want to give any info for anyone to offer any advice of value. he just wants to be sent on a wild goose chase to install multiple PHP versions which he will unsuccesfully set up and will lead to more posts on how to install multiple operating systems to accomodates his multiple versions which will lead to another non relating topic about ponies and kitty cats...all of which has nothing to do with his problem nor will it solve his "problem".
     
    NetStar, Apr 21, 2015 IP
    malky66 likes this.
  16. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #16
    It's why I pony up the whopping seven and a half bucks a month (oh noes) for a proper VPS where the provider has a "hands off" policy in place; anything goes wrong on the software side it's entirely on my head. No handholding, no worries about "shared" hosting.

    But I'm a control freak. (Yeah I know, who knew right?)
     
    deathshadow, Apr 21, 2015 IP
    malky66 likes this.
  17. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #17
    Granted, a VPS is better for a lot of purposes, but needs a bit of taking care of - which I currently can't be bothered doing. Granted, I pay about $10-$15 pr month for my shared hosting, but that is simply because the costs in this icecrusted country are ridiculous :)
     
    PoPSiCLe, Apr 22, 2015 IP
  18. Mkcoy

    Mkcoy Well-Known Member

    Messages:
    1,602
    Likes Received:
    77
    Best Answers:
    2
    Trophy Points:
    195
    #18
    I have not bought any email list you stupid asshat! Read what has been said... I even told you in that post WHY I was asking. It just isn't sinking into your micro brain!!

    It says on the page in black and white "Im simply asking out of curiosity because I have to do some article on cyber crime and wanted to know as well, like if it doesn't work, then why does it continue even today?" and "I'd never send spam emails and get into all of that myself bit did just wonder."

    What part of that can you not understand!!?? What is your problem you douschebag!!!!

    And I was asking this for someone else who needs 5.4 for something to work on his server. We are not all major geeks like you. Stop going around spreading shit and making up false crap about people.

    What an asshat!
     
    Mkcoy, Apr 22, 2015 IP
  19. Mkcoy

    Mkcoy Well-Known Member

    Messages:
    1,602
    Likes Received:
    77
    Best Answers:
    2
    Trophy Points:
    195
    #19
    Sean, have a word with this moron on the side will ya?
     
    Mkcoy, Apr 22, 2015 IP
  20. Mkcoy

    Mkcoy Well-Known Member

    Messages:
    1,602
    Likes Received:
    77
    Best Answers:
    2
    Trophy Points:
    195
    #20
    Hiding behind his computer screen, he thinks he's the big man and can talk to people how he likes. Probably to make up for the fact that he has a little willy.

    I'd like to see him talk to me to my face like that. :)
     
    Mkcoy, Apr 22, 2015 IP