01 8 / 2013
14 6 / 2012
Also known as a great way to waste a night!! :)
First, of course, prepare properly:
1. I assume you have yum on said RedHat system. If you do not, then call your sys admin and yell at them. May the universe have mercy on you, not to mention your sys admin.
# which yum
2. Shut down your apache server. Do it now, before you forget to restart it and go insane reinstalling php 14 times.
#httpd -k stop
3. Determine which php you actually have on your system. Type this into the shell prompt:
# rpm -qa | grep php
You will see a list of packages you have installed. Copy that list so when you reinstall php, you can remember what packages you need.
4. Grab your current php config.
The php config is useful just in case after you install your PHP 5.3, your entire web app will stop working. The config will help you retrieve the packages you need or dependencies you need, etc.
Uninstall existing php
1. Type this into the prompt for each of the packages you have:
# yum remove php
# yum remove php-common
and so on, and so on. To check if all php packages have been removed you can either re-run the rpm command from step 3 of the prep above, or just type ‘which php’ at the prompt. As long as any php packages are around, the php directory will be there too… although in a corrupt state. Anyhow, make sure all is gone.
2. Time to refer to your handy list of packages! For each package you need, make yum install it. Here is a pretty common basic package list that should get you mysql and xml functionality. Refer to the previous output of rpm and the old config file you saved to find the list of packages you need.
# yum install php53 php53-cli php53-common php53-mysql php53-pdo php53-xml
3. Boldly restart your apache server.
# httpd -k start
There is no need to modify the config file for apache - you should’ve had php module enabled before, and upgrading php doesn’t change it. You are fine.
4. Sanity check:
You can use
# php -v
on the command line to check the version of php you now have. You can also use php_info() in your code to dump all php config to a web page.
Why would you want to do this? By default, RedHat still comes with PHP5.1, which is fine in itself, but is not compatible with lots of yum-installed packages that your app may need. To install those packages (such as zip, for example) you have two options:
1. Recompile php5.1 with appropriate config options enabled
2. Install php5.3 which either includes those packages already, or can allow yum to get the packages and configure php
In many cases, option 2 is easier. You would know that you are having 5.3 compatibility problems when, after you try to grab a package in yum, you get error messages about php53-common not being compatible with php-common, etc.
28 8 / 2011
30 4 / 2011
How the media expected people to react:
How people expected they would react:
How people actually reacted:
Most accurate thing I have seen all night