Koozali.org formerly Contribs.org

Need to update PHP support from 5.3.3 to 5.5.x

Offline brunp

Need to update PHP support from 5.3.3 to 5.5.x
« on: February 10, 2014, 04:02:57 AM »
Any suggestions or instructions on how to get this done? the repo's don't contain an update and I need
the functionality in 5.5.x  (well at least 5.4.x). Is there a way to upgrade? Is it safe? I should think it is
possible. I would prefer to upgrade to 5.5.9 which is the most recent stable version.

Please let me know as soon as possible.

Thanks
Paul

Offline janet

  • ****
  • 4,793
Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #1 on: February 10, 2014, 06:53:15 AM »
brunp

Note that using a newer version of sme & underlying OS is probably the better idea to reduce dependency issues & incompatibilities etc, so take a look at sme9beta3, which still has php 5.3.3-27.
Then you can search for rpms for CentOS 6.5 to upgrade php even further, if available, & if someone has compiled them etc.
Same comments apply to sme8 if you prefer to stick with that.

You will most probably have problems when you do regular upgrades as you have a non standard version of php installed, so you are really on your own then.
There may also be "clashes" with other contribs you wish to install that require a certain (lower or specific) version of php.
You will have to sort these issues out as you go along, if at all possible, & you may have to uninstall some contribs in order to keep the newer php version. Upgrading php will not be without difficulties.

When looking for answers it's recommended to search the forums first
eg on php

Here are some threads that may be useful
http://forums.contribs.org/index.php/topic,50486.0.html
http://forums.contribs.org/index.php/topic,50582.msg254781.html#msg254781
http://forums.contribs.org/index.php/topic,50335.msg253064.html#msg253064
http://forums.contribs.org/index.php/topic,50539.msg254567.html#msg254567

You should also read this Contrib wiki which refers to installing a newer version of php to work with specific contribs etc.
http://wiki.contribs.org/PHP5
This will give you some clues as to what approaches can be safely taken.
This php5-cgi contrib is now buggy & has security issues so should not be used.
It is a guide to earlier attempts to answer the same problem you have now.

Unfortunately there is no magic "3 step" answer.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline brunp

Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #2 on: February 10, 2014, 01:48:51 PM »
unfortunately, upgrading to a BETA version of an O/S is not an option. This is a production server and client does not want
beta software running on site.

I am somewhat surprised that there is no easy path to upgrade PHP. Thanks for the links, I will look into it.

Cheers,
Paul

Offline Stefano

  • *
  • 10,779
  • Skype account: maghissimo
    • Smeserver italian community
Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #3 on: February 10, 2014, 03:00:03 PM »
I am somewhat surprised that there is no easy path to upgrade PHP. Thanks for the links, I will look into it.

if you are used to work with RH/CentOS, you should not..
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Offline brunp

Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #4 on: February 10, 2014, 03:04:15 PM »
if you are used to work with RH/CentOS, you should not..

I don't follow you here....if I am using to using RH/CentOS, I should not update the php version? So, are my only options to alter my PHP
code to comply with 5.3?  I suppose this is an option, I wish I didn't have to do. I think my only issue is the way I used array's, but who knows.
I developed the code on my MAC which had PHP 5.5 on it, so wanting to retest everything to determine 5.3 compliancy is really annoying
and will delay my deployment.

Paul

Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #5 on: February 10, 2014, 06:15:34 PM »
My suggestion for a website which requires a particular newer version of php is to deploy it on its own small VM on your LAN, and use proxy-pass in SME server.

Once SME9 is completed and deployed, I'd recommend people look at Red Hat Software Collections to deploy multiple versions of different parts of the software stack on the same system, when needed.

https://access.redhat.com/site/documentation/en-US/Red_Hat_Software_Collections/1/html/1.0_Release_Notes/chap-RHSCL.html

Offline janet

  • ****
  • 4,793
Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #6 on: February 10, 2014, 09:04:20 PM »
brunp

Quote
I am somewhat surprised that there is no easy path to upgrade PHP. Thanks for the links, I will look into it.

I did not say php cannot be upgraded or that it is hard to upgrade, in fact those links lead you to 2 repos & 2 methods of upgrading, which is quite easy to do & would take less than 5 minutes to complete, refer webtatic repo method for one.
Getting the version you want may need more investigation, & as advised, there may be other dependency issues you need to deal with, again those links will lead you to some of the potential issues.

BETA versions of SME server are usually quite good, especially once a few betas have been developed/released.
Remember they are using an already proven & supported CentOS underlying operating system, so the beta components are the templating & event functionality & other packages etc specific to SME.
Much/most of that is a copy from previous working versions of SME server which just need tweaking for the newer underlying CentOS OS.
Take a look at SME 9.0beta3, you will be pleasantly surprised.
I had it installed in 10 minutes, & fully configured for my network etc in another 20 minutes, made slightly slower by using the text based  server manager (rather than the GUI version).

Charlie has given you a very good technical reason to use SME9 in future, ie multiple versions of components of the software stack, which I assume will answer your php version need.

If you want "bleeding edge" versions of packages etc, IMO SME9 is the better place to be.
« Last Edit: February 11, 2014, 12:43:26 AM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline brunp

Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #7 on: February 10, 2014, 09:14:31 PM »
we only have one server. is there an upgrade path for SME9?

Paul

Offline janet

  • ****
  • 4,793
Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #8 on: February 10, 2014, 09:22:05 PM »
CharlieBrady

Quote
https://access.redhat.com/site/documentation/en-US/Red_Hat_Software_Collections/1/html/1.0_Release_Notes/chap-RHSCL.html

That's great, SME server future looks good & easier to manage software version issues.

I see php 5.4.14 is available, which would suit brunp's immediate requirements.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline janet

  • ****
  • 4,793
Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #9 on: February 10, 2014, 09:52:56 PM »
brunp

Quote
is there an upgrade path for SME9?

CentOS 6.x (sme9) does not support direct upgrade from earlier versions, so you cannot upgrade sme8 using a sme9 CD.

The only supported upgrade is to:
1) perform a full backup on your sme 8 ideally to locally connected USB
2) install fresh copy of sme9 from CD
3) restore from backup
4) install previously used contribs (sme9 compatible versions).
5) tweak any custom templates if necessary

Please familiarise yourself with sme9beta3 & make sure all your critical needs are functional & supported before using it. Review bug reports regularly to see if any problems arise & any fixes become available.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #10 on: February 11, 2014, 01:10:12 AM »
What version of PHP is included with SME 9? I'm also looking to create an SME server with PHP 5.5 but since my use is strictly for web site testing purposes the beta version of SME would be fine as long as it will work on the old Pentium 4 computer I plan to use as the test server and it includes or can easily be upgraded to PHP 5.5 without causing problems with MySQL. Basically I want to ensure the web site is fully compatible with PHP 5.5 in advance of it becoming the default version of PHP on web servers. I will require phpMyAdmin but that is easily downloaded from phpmyadmin.net and installed in an ibay to allow the PHP update that smeserver-phpmyadmin prevents due to dependency issues. I just yum install php-mcrypt and php-php-gettext in advance and use the phpMyAdmin/config.inc.php template from the SMEserver version of phpMyAdmin to generate the configuration file needed to allow it to access MySQL. While I've had a bit of problem getting it to access the /etc/phpMyAdmin/config.inc.php file I suspect that was due to an incorrect permissions setting for the folder on my part.

My problem has been that every time I've tried update PHP under SME 8 I can successfully get it to version 5.5.8 but MySQL totally quits working. Of course, I've been using the Remi PHP5.5 repository to do the update and I suspect that the problem is due to the fact that it is made for general Red Hat/CentOS rather than SME. I didn't know that PHP 5.5 was also available from the Webtatic repository so I'll give that a try and see if it works better. It would be nice if the listings for the extra yum repositories had a rough list of what was included in each repository. I think the Remi version was automatically updating MySQL as well. I don't know why that would be a problem unless SME is placing the MySQL program files in a different location than what is used in standard CentOS. If the updated RPM files then placed the newer MySQL program files in a different location rather than just updating the files in their current location I could understand how the problem is occurring.

Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #11 on: February 12, 2014, 08:05:17 AM »
I FINALLY managed to update a test server using SME 8.0 to use PHP 5.5 without causing MySQL to fail after reading through some of the links here. Here is what I had to do in order to do it.

First create a new yum repository for Webtatic EL5 (not the CentOS version listed in the SME extra yum repositories documentation since that one doesn't include PHP 5.5) as follows:
Code: [Select]
/sbin/e-smith/db yum_repositories set webtatic-el5 repository \
Name 'webtatic - EL5' \
MirrorList 'http://mirror.webtatic.com/yum/el5/$basearch/mirrorlist' \
EnableGroups no \
GPGCheck yes \
GPGKey http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy \
Visible no \
status disabled

signal-event yum-modify

Next install the yum replace add on from the new repository:
Code: [Select]
yum install yum-plugin-replace --enablerepo=webtatic-el5
Now you can upgrade your version of PHP to version 5.5.9 as follows:
Code: [Select]
yum replace php --replace-with=php55w --enablerepo=webtatic-el5
If you need phpMyAdmin like I did then before doing the "signal-event post-upgrade; signal-event reboot" perform one more install:
Code: [Select]
yum install php55w-mcrypt --enablerepo=webtatic-el5
The php-gettext needed by phpMyAdmin is apparently already included in the php55w-common rpm so you won't have to install it separately. Other PHP add ons such as php55w-pear are available in the Webtatic EL5 repository if you need them, you can view the list at http://us-east.repo.webtatic.com/yum/el5/ choosing the i386 or x86_64 directories as appropriate for your server. Of course to use phpMyAdmin with this you will have to forgo the SME contribution and download the current version directly from http://www.phpmyadmin.net

To make phpMyAdmin usable:
1) Create a new ibay specifically for phpMyAdmin (I would suggest calling it phpmyadmin) and set it with the appropriate access permissions being sure to enable dynamic content (i.e. PHP). Then delete the index.html file from the html folder of this new ibay.
2) Load the complete phpMyAdmin file set you've just downloaded into the html folder of the new ibay. The root directory for phpMyAdmin should be the ibay's html folder so load the entire CONTENTS of the phpMyAdmin folder you've downloaded into it and not the phpMyAdmin folder itself.
3) Create a new folder in /etc called phpMyAdmin and set permissions on it to at least 775.
4) Create a folder in /etc/e-smith/templates-custom named phpMyAdmin and then inside that create a folder named config.inc.php
5) Inside the new /etc/e-smith/templates-custom/phpMyAdmin/config.inc.php folder create three files, an EMPTY file named template-begin, an EMPTY file named template-end and one other file (I used the "10config" name used by the smeserver-phpmyadmin contribution where this comes from) containing the following:
Code: [Select]
<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 2.9.0.2 setup script by Michal Čihař <michal@cihar.com>
 * Version: $Id: setup.php,v 1.36.2.3.2.1 2006/10/03 13:11:08 nijel Exp $
 * Date: Thu, 12 Oct 2006 16:17:17 GMT
 */

/* Servers configuration */
$i 0;

/* Server localhost (config:root) [1] */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password']        = '{
open (PW, "/etc/openldap/ldap.pw")
        || die "Could not read LDAP password.\n";
my $pw = <PW>;
chomp ($pw);
close PW;
$OUT .= "$pw";
}'
;
/* End of servers configuration */

?>
6) expand-template /etc/phpMyAdmin/config.inc.php
7) You should now have a config.inc.php inside the /etc/phpMyAdmin folder you created. If can figure out how to get your phpMyAdmin to directly access this file you are set to go. Otherwise, do like I did and just copy the password from the file and then log in to phpMyAdmin as root using this password. In that case the very first thing to do is create a new user with all privileges and a password you can remember to use for all future access to phpMyAdmin which you will access as http://server_url/phpmyadmin_ibay_name/

After spending at least two weeks trying to figure out how to get a PHP 5.5 upgrade to work properly I figured I'd better share the information with others that might be trying to do the same thing. Besides, I expect to reuse this information myself to create a test server with PHP 5.5 at work and I wanted it to be easily accessible.

Offline Stefano

  • *
  • 10,779
  • Skype account: maghissimo
    • Smeserver italian community
Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #12 on: February 12, 2014, 12:03:16 PM »
I don't follow you here....if I am using to using RH/CentOS, I should not update the php version? So, are my only options to alter my PHP

RH aims to stability and security.. once a version of RHEL is released (let's say RHEL 6) with (let's say) php 5.3 and mysql 5.2, it will never make any version upgrade during all the life time of the distribution..

please remember that RH often backports security path on all the rpms

CentOS (and SME) inherits this modus operandi

if you are used to work with RH/CentOS you should be aware of that..

you can always upgrade your php/mysql/whatever using external repos, but you do it at your risk.. fortunately there are many repos that we can rely on and we can trust.

in any case, if you really need bleeding edge version of php/mysql/whatever, I strongly suggest you to create a small, minimal VM with all you need..
don't play with your server..  that's all
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Offline brunp

Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #13 on: February 13, 2014, 12:09:28 AM »
interesting....although I do not have an iBay called phpmyadmin, I can't seem to create an ibay with that name as an account is already created with that name,

however, I did find where all my files are stored and it was a local install, so I can simply replace the files and perform the necessary config file updates after the fact. :-)

Paul
« Last Edit: February 13, 2014, 12:28:53 AM by brunp »

Offline janet

  • ****
  • 4,793
Re: Need to update PHP support from 5.3.3 to 5.5.x
« Reply #14 on: February 13, 2014, 08:08:06 AM »
brunp

If you have installed phpmyadmin, then there is probably a folder in /opt with that name, and/or there is an alias (eg http://yourdomain.com/phpmyadmin) for web access, so therefore that name cannot be used a second time on your system. Many contribs rpms will install to /opt
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.