Php 5 Upgrade

From PikaDocs

By Aaron Worley

Table of contents

PHP 5 and Pika CMS

Starting with version 3.04, Pika CMS requires PHP 5 to be installed on your Pika server. 3.04 uses some of the new features in PHP 5 to improve performance and to make it even easier for programmers to add new features to Pika. Note that earlier versions, 3.03 and older, are supported with either PHP 4 or PHP 5.

Before You Start

The upgrade procedure normally will take around 20 minutes. I suggest giving yourself at least an hour in case there are complications. During the procedure, the web server - and your Pika site - will be unavailable. Give your Pika users some warning well ahead of time that the site will be down for maintenance. Also, send a heads up to Pika Software so we can have someone on standby if there are problems.

Upgrading on Windows

If you run Pika on a Windows server, you should follow the normal PHP installation procedure, using the PHP 5 package from [www.php.net] instead of the PHP 4 package.

Upgrading on Linux

Normally, if you run Pika on a Linux server, your Linux vendor will supply new versions of PHP via their software update service automatically (for example, Red Hat/Fedora's up2date, or Debian's apt-get.) However, most vendors are not yet providing PHP 5 packages yet. Until PHP 5 is better supported by Linux vendors, the PHP 5 upgrade will need to be done manually, as with a Windows upgrade.

The following are instructions for doing a manual upgrade from source code, my recommended method. The instructions are targeted for Red Hat or Fedora systems. If you have a different type of Linux or UNIX, you may need to modify the commands slightly.

  • Log into your Pika server.
  • Run the "su" command to gain root privileges.
[aaron@moose aaron]$ su
Password: 
[root@moose root]# 
  • Stop the Apache service.
[root@moose root]# /sbin/service httpd stop
Stopping httpd:                                            [  OK  ]
  • Use "rpm" to determine which PHP 4 packages are currently installed.
[root@moose root]# rpm -qa | grep php
  • Uninstall any packages that were listed with the command "rpm -e package_name".
  • Install the httpd-devel (Apache development) package, if not already installed.
[root@moose root]# up2date install httpd-devel


  • Download the latest version of PHP 5 to the Linux server.
  • Extract the PHP source code.
[root@moose root]# tar xvfz php-5.x.x.tar.gz
  • Change to the source code folder.
[root@moose root]# cd php-5.x.x/
  • Run configure.
[root@moose root]# ./configure --with-apxs2=/usr/sbin/apxs --with-mysql \
 --with-config-file-path=/etc
  • Run make install.
[root@moose root]# make install
  • Backup your old PHP configuration file, and create the new file.
[root@moose root]# mv -i /etc/php.ini /etc/php.ini-php5upgrade
[root@moose root]# cp -i php.ini-dist /etc/php.ini
  • Edit php.ini, change the global_registers setting from "Off" to "On",
  • Create an Apache configuration file named /etc/httpd/conf.d/php5.conf, it should have the following contents:
AddType application/x-httpd-php .php
DirectoryIndex index.php
  • Start the Apache service.
[root@moose root]# /sbin/service httpd start
Starting httpd:                                            [  OK  ]
  • Log out
[root@moose root]# exit
  • Finished.

If any errors occur, please call Pika Software for assistance.