Hi. I am a newbie to CentOS/Virtualmin and everything it offers.
I am working for an IT company. Currently we have CentOS 6.6 installed. We need to update our PHP from 5.3.3 til 5.4+, but the guy we had hired to do that, has left us. We have quite a few users/servers. If I log in, using PuTTY, as root and enter yum install php54w - then it will give me the option to update the PHP version using Virtualmin, right? It wont replace the old PHP with a new one, on every single virtual server, right?
I know it may sound like a stupid question, but as I'm new to this, I want to be sure, that I won't mess things up for every single user/virtual server :).
Linux 2.6.32-431.20.5.el6.i686 on i686 Operating system CentOS Linux 6.6 Webmin version 1.730 Virtualmin version 4.13.gpl GPL
Howdy,
Hmm, did you perhaps enabled a third party repository?
The PHP version you described isn't available by default from CentOS, so I'd be concerned that it's coming from a third party repository.
If that's the case, my recommendation would be to disable any third party repositories.
My recommendation for using PHP 5.4 on CentOS 6 would be to use the instructions here:
https://www.virtualmin.com/documentation/web/multiplephp
This seems to be exactly what I've been looking for - thank you sooooo much! I will try this tomorrow!
But... Just to be clear: When I follow the instructions below, I will add PHP 5.4 - but it will not overwrite the old one, just add another option, right? So it doesn't really have any effect, until I change it on one of the virtual servers on Virtualmin?
Log into your server over SSH as root
Setup the SCL repository with this command: yum install centos-release-SCL
Install PHP 5.4 and scl-utils with this command: yum install php54 php54-php-cli php54-php-mysql php54-php-gd
Howdy,
That's correct, the instructions above install a second version of PHP, they do not overwrite your existing version.
You can then choose in a per-domain basis which PHP version to use.
Note that I highly recommend disabling any third party repositories before attempting that, or else it could inadvertently pull in software from that repository, which could end up doing unexpected things.
-Eric
Now I might sound like the total newbie I am...- When you say "disabling any third party repositories", what do you mean exactly?
Thank you for helping newbies like me - it is much appreciated :).
Connect with SSH, "cd /etc/yum.repos.d" and then "ls" or even better "ls -l" ("l" is small letter "L" just to make it clear). Copy the list here and someone will tell you if you need to disable some repo or not and how.
P.S. If you dont want to navigate in repo folder you can immediately type "ls -l /etc/yum.repos.d".
- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.
-rw-r--r-- 1 root root [digits] Oct 23 2014 CentOS-Base.repo
-rw-r--r-- 1 root root [digits] Oct 23 2014 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root [digits] Oct 23 2014 CentOS-fasttrack.repo
-rw-r--r-- 1 root root [digits] Oct 23 2014 CentOS-Media.repo
-rw-r--r-- 1 root root [digits] Oct 23 2014 CentOS-Vault.repo
-rwsr-s--- 1 root root [digits] Jun 3 2011 virtualmin.repo
-rw-r--r-- 1 root root [digits] Dec 7 2012 vmware-tools.repo
Howdy,
Those repositories look good!
The only non-standard one is the vmware-tools repo, but I suspect that one would be safe.
-Eric
@StefanN: If you want to be on safe side install nano (yum install nano) and then "nano /etc/yum.repos.d/vmware-tools.repo", change "enabled=1" to "enabled=0", save (ctrl + o) and exit (ctrl + x). After that follow instructions in https://www.virtualmin.com/documentation/web/multiplephp.
- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.
Hmm.. Nothing happened - I followed the instructions, but:
[root@vm1 ~]# yum install centos-release-SCL
Loaded plugins: fastestmirror, presto
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.fysik.dtu.dk
* extras: mirror.fysik.dtu.dk
* updates: ftp.crc.dk
No package centos-release-SCL available.
Error: Nothing to do
[root@vm1 ~]# yum install php54 php54-php-cli php54-php-mysql php54-php-gd
Loaded plugins: fastestmirror, presto
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.fysik.dtu.dk
* extras: mirror.fysik.dtu.dk
* updates: ftp.crc.dk
No package php54 available.
No package php54-php-cli available.
No package php54-php-mysql available.
No package php54-php-gd available.
Error: Nothing to do
I just found this thread - could it be the solution to my problem?
***
Just a FYI to people using the PHP54 SCL repository to run 5.4.16 alongside their stock 5.3.3. The repository was emptied out a few days ago. I left a message on the forum and it looks like there is a conflict with Red Hat about directory names.
This is the page that contains the information
https://www.virtualmin.com/documentation/web/multiplephp
A few revisions to this page are needed,
Looks like the PHP54 version is going to be maintained at 5.4.16, this is the same stock PHP version that will be used in RHEL 7/CentOS 7 when it comes out.
Looks like CentOS is going to be providing the PHP54 (at least for now)
This is still 64 bit only, When a new version is release it should be a semi direct upgrade, the files there have been there since Dec 2013.
Note: don't install this package "php54-php" this provides mod_php for the 5.4 package, it will conflict with the installed 5.3.3 package. (yum shouldn't let you anyways)
Existing installs:
rm -f /etc/yum.repos.d/software_collections_php54.repo
yum clean all
yum install centos-release-SCL
New installs:
yum install centos-release-SCL
yum install php54 php54-php-cli php54-php-mysql php54-php-gd
***
But.. The clean all kinda scares me. I want to keep our PHP 5.3.3, as lots of our customers are using this version - I don't want to risk anything :).
Thanks for your patience :D
Howdy,
Hmm, I hadn't heard about all that, it looks like we'll need to look into all that to figure out what's going on and make sure the procedure we have described in the documentation is correct.
However, the command "yum clean all" is safe -- it only clears out yum metadata, it doesn't touch your packages.
Let us know if the above works for you!
BTW, if you have a CentOS test server, you could always try this procedure there first.
What was the link to the information you shared above?
I'd love to read more about that. Thanks!
-Eric
Thank you once again. I will try it later.
The link is: https://www.virtualmin.com/node/32388
Tried the above solution.
Got this:
No package centos-release-SCL available.
Loaded plugins: fastestmirror, presto
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.fysik.dtu.dk
* extras: mirror.fysik.dtu.dk
* updates: mirror.fysik.dtu.dk
No package php54 available.
No package php54-php-cli available.
No package php54-php-mysql available.
No package php54-php-gd available.
I tested php 5.4 from this link: https://webtatic.com/packages/php54/ on Centos 6.6 and it was working without any problem. If you want to keep both versions just DONT run "yum install yum-plugin-replace" and "yum replace php-common --replace-with=php54w-common". After that go to Vmin - System settings - Server template - Apache website and under "Default PHP" select 5.3.3 because default settings are set to "highest available". Then check virtual server(s) if they pick up this change, if not change manually to 5.3.3 (PHP Versions). There is problem with php 5.4 and mcrypt on Centos 6 or better to say lack of mcrypt for this version of Centos.
But you can always use .htaccess and "AddHandler application/x-httpd-php54 .php" to use different version of php. Anyway do NOT try to upgrade your existing php because it will break everything, including Vmin/Wmin.
P.S. Once done with installation of php 5.4 go to your repo folder (/etc/yum.repos.d) and edit repo from webtatic from "enabled=1" to "enabled=0". In the mean time do not update anything on your system just to be sure it will not install something from their repo.
- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.
Great! I hate to be a pain in the a..- behind, but just to be clear (after all, I am a newbie):
I fist use rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm.
Then I use yum install php54w.
That's it, right? Then I have the option to select PHP 5.4 in Virtualmin on whichever Virtual Server I want to, right?
I have selected PHP 5.3.3 as the Default now, I did that before I tried to install the first time :).
Regarding your "P.S". I have googled a bit, just to try and find out on my own and avoid asking to many questions (toooo late!) - but I failed to find out what you mean. Sorry for all the questioner - but better safe than sorry :).
If your intention is to directly upgrade production servers i would strongly recommend to hire someone to do this job. You could just hire someone only for this task. Instructions on webtatic are really simple and easy but i gave you additional help to be sure you will not upgrade your existing php 5.3.3 and my "p.s." should be even easier to understand. Said all this if you break something probably would require to hire some professional to try to repair everything or fresh OS install. Hope you get this and in worst case scenario probably no one here can help you.
To install -
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
and thenyum install php54w
. Thats it. You should have both php 5.3 and 5.4.Then follow my previous post in this topic but instead of "vmware-tools.repo" turn off webtatic repo. I dont know the exact name but you should be able to spot new one in your repo folder.
- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.
I'm trying to have multiple versions of php in a i686 and I had not been able to use webtatic as explained here.
$ yum install php54w
Error: php54w-common conflicts with php-common-5.3.3-46.el6_6.i686