Shared Hosts and PHP5 Upgrades

Tweet

Ivo Jansch made a comment in relation to this blog which got me thinking;

We have the same problem. The backwardscompatibility issues are small, and we could easily fix our own apps. But we also do hosting for several hundreds of websites not created by us. Getting all our customers to fix their sites (and providing them with a means to test) will be hellish.

What strategies can be employed by shared hosts to deal with this problem? Given that there isn’t a magic wand to fix it and many shared hosts have limited manpower, what to do?

For me, wearing a “shared host customer” hat, the number 1 issue is information – if a host want’s to migrate to PHP5, they need to communicate a clear schedule for doing so, with realistic time frames (e.g. at least 3 months warning). With that should be the warning that customers need to start testing their code against the new PHP version.

In general, as I’ve said before, think there is room for improvement on the type of information some shared hosts provide. All PHP installations are not the same, even when the version numbers are equal, that magic php.ini file or available extensions being the difference between code that “works” and code that doesn’t. To that extent think shared hosts need to release full details here – the exact PHP 5 version they plan to use, a sample php.ini reflecting how PHP will be configured, a list of extensions which will be available and anything else that might be relevant.

Those steps should be enough to satisfy experienced PHP hands. But what about those for whom PHP means just downloading and FTPing code found via places like Hotscripts?

Imagine the best approach there is giving customers an environment to be able to test their code on. The expensive but perhaps most effective would be laying on a test server running PHP5. Reality, cost and broken URLs are an issue there though.

An alternative approach might be providing users with a “ready to install” LAMP or WAMP environment which reflects the planned configuration but they can run on their own PCs – something along the lines of XAMPP or similar.

Somehow a technical solution would also be nice. Wonder if sandboxing capabilities of runkit could be used to help shared hosts spot customers problems for them automatically. That doesn’t fix the problem but at least people can be warned. Perhaps similar info could be extracted using PHP on the command line using the lint option $ php -l

What else?

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://aplosmedia.com/ Eric.Coleman

    The real issue here is people’s lack of upgrading there own code.

    Alot of people I have seen have had php bb installs way out of date. I wouldn’t even let a non-latest phpbb install on my server.

    If people take care to keep there software up to date, migrating to php5 isn’t -that- big of a deal, and your server is safer all around.

  • Stefano F.

    There’s another alternative, which my host did choose last year: install PHP 5 and configure Apache to use this relaese for script files having the extension .php5.

    I just use .htacces to revert this directive and everybody is happy.

  • http://aplosmedia.com/ Eric.Coleman

    Stefano:

    As far as I am aware, don’t you need to have one of the php version as cgi then? Some people might not want to do that.

    Actually, now that I think about it, can’t you edit the sapi source for your server, and change the php module name that it generates? I briefly did this for plesk becuae they were using php_apache.dll or something nonstandard..

    Can anyone confirm this?

    — Eric

  • warjockey

    well it has to be done at some point. And I think right now share hosts are just being lazy with taking appropriate steps to get PHP5 up and running ASAP.

    Stefano’s host has came up with a good idea but still php5 should become the standard and force everyone to upgrade.
    Same with MYsql. We’re at version 5 now, when are we gonna see any of that on shared hosts? Most of them are still running 3.xx without INNODB support. Just rediculous

  • aaa

    DOWNLOAD Windows Vista pre-Beta 2 build 5259: http://windows.czweb.org/show_article.php?id_article=379

  • http://www.wreach.com WithinReach

    All this talk of upgrading code, and how people should be doing it is interesting, but misses a big point – a lot of that code is written/used by clients (in my case) who paid me to develop application X or Y in PHP/mySQL. Runs fine, no problems, etc.

    Who supports the cost of upgrading to PHP5? Clients? So many refuse to do so, as they ‘already paid for it’. We can talk about short sightedness til the cows come home, not a thread I want to open.

    It’s hard to set aside time (and lose money) to migrate dozens of clients to a ‘new’ environment, when they cannot see the immediate benefits. We’re not talking about upgrading code or features, just moving from PHP4 to PHP5 and fixing the BC anomalies as they arise. No one wants to pay for that.

  • Greg

    another major factor, from my limited experience with shared hosts, is that shared hosts seem very reluctant to modify anything if it doesn’t come as part of the standard install of the control panel they use (plesk, ensim, direct admin), so unless these control panels have good support for the new versions, the likelihood that a shared host will attempt to upgrade seems fairly low…

  • http://aplosmedia.com/ Eric.Coleman

    WithinReach, you opened the can, and shortsighted ness is a huge deal. If your code was compliant for 4.1+ then you shouldn’t have very many, if ANY issues with php 5.

    Greg, i’ve never touched ensim or direct admin, but for plesk, it’s that it defaults to utilizing the o/s’s software.

    That’s a great thing, but people don’t realize than 95% of the time you can upgrade without worries. All it takes is a quick check to your cp providers forum and you should be fine. And if searching isn’t your thing, submit a support ticket, it never hurts.

  • http://sproutworks.com sproutworks

    My shared host (DreamHost) installed PHP 5 a long time ago. They were able to avoid major problems by simply offering everyone a choice of PHP 4 or 5 on a per domain basis. The default is 4, and if you want to use 5, it’s a simple matter of clicking a radio button in the control panel. It’s a very elegant solution, and I think more hosts should do this.

  • http://www.digitalsandwich.com mjlivelyjr

    All of my company’s production servers run PHP4 and PHP5 as parallel apache mods. In order to do so I did have to make some edits to the php 5 source and there are a few wierd things that occur (Can’t use dynamic extensions, they have to be compiled into the php binary) but we have been running all of the servers now since about a month after 5.0.0 was released with no problems.

    I describe in fairly roughshod detail what I did here: http://www.digitalsandwich.com/archives/14-PHP5-and-PHP4-Running-on-SAME-apache-server.html

  • Stefano F.

    warjockey said: Stefano’s host has came up with a good idea but still php5 should become the standard and force everyone to upgrade.

    When one is talking about the devil … my host just announced that this night the PHP 5 environment will be upgraded to 5.1.1! These guys are really top notch in this respect ;) There’s still the option to use PHP 4 and even 3!

  • http://www.peterakkies.com/ Kilroy

    My host turns me down saying “Plesk does not support PHP5 yet and we will not do so until Plesk does.” I’ve been considering switching to 1and1.com or Godaddy or some other major host for a long time now and this might just be the turnpoint. I think it’s only fair of hosts to offer me the option between PHP4 and PHP5.

    I must say though, my host does have the latest PHP4 installed, which is nice of them.

  • http://www.lowter.com charmedlover

    I so wish that my host had PHP5. I know that all of my code works, as I run it on my own machine, which is PHP5. It’s one reason that I’d want a dedicated server, as I could control what software I can use.

  • lajkonik86

    I think the most suitable approach for larger hosts would be to simply sell hosting with php 4 and php 5.
    Just let the customer chose what they want. Just provide them with the option to switch but don’t force them. At least not if you want to lose customers.

    Once demand for php4 become to low, then switch.

    Might be an interesting niche market… php4 hosting for people with excisting ads but no desire to switch.
    Like a company which had a website build but maintains almost no it staff. It’s faster to switch to a different host then rewrite your apps.

  • http://www.errewf.it RaS!

    I would like my host switch to PHP5, ‘cos I’m rewriting some parts of my applications…

  • http://www.divbyzero.org Div By Zero

    I think many web hosts will keep current server on PHP4 while adding new server with PHP5 and try not to force customers to switch anytime soon.
    When you have some 200 different script running on a server and with customers who don’t have a clue about BC issues it can be really painfull to force a switch.

  • eWebtricity

    1and1 offers PHP5 on it’s managed servers only if you request it or you can get a dedicated server (ie: root I,II,III is their package names) and install PHP5 yourself. They don’t have support forums but there is the independently run http://www.1and1faq.com peer support forums for 1and1.com specific products and services.

  • Ambush Commander

    My host simply says that PHP 5 is not stable enough, and until whatever tests they’re sysadmins do come out acceptable, they won’t install it.

    Until a product has been announced as stable, tested and verified that it is suitable for a production environment, such as our one, we cannot afford to install it and risk the integrity of our servers.

    :-( Must be because of the 5.0 fiasco…

  • pb

    1and1, PLesk 7.5.4

    Well after digging about in our server I have found that Plesk has it’s own httpd, it runs 1.3 while the virtual hosts run version 2. The lastest Plesk runs PHP5 on the apache 1.3 httpd on port 8443 while 1and1 uses the default Fedora core 3 package which is PHP4.3 for all the virtual hosts that run on port 80/443.. This is probably similar on a lot of servers that have plesk.

    1and1’s support does not give you this information/maybe not know but I have phpinfo’d from the plesk web dir and got the apache 1.3 / php5 details which are completely different than when run from within the virtual host dirs you configure with Plesk.

    The apache 2 install is not the dev version so you do not have the apxs for the compile. If you look for apxs you get the 1.3 one on /usr/local/psa/admin/bin/apxs only.

    the apache 1.3/php5 version httpsd.conf can be found
    /usr/local/psa/admin/conf/

    Though I think plesk may have trouble doing the php5 enabling in the httpd.include for the virtual host due to syntax change . As I haven’t had the time to install php5 on our servers so I cannot confirm this. Plus I’d probably bugger it royally :).

    Hope this helps someone when it comes to Plesk/web host upgrade questions. 1and1 are pretty good except for their support which is a bit lax and unhelpful on these issues. You have to reverse engineer the server yourself. Though they are cheap and big and their support people probably are the ones who suffer because of it..