Wednesday, July 6, 2011

15 steps for running PHP 5.3 and PHP 5.2 on the same Apache server

Recently i faced with a case when i need to run an old website which requires PHP 5.2 when my main version on the test server is 5.3.5

System configuration:
Debian Squeeze 6.0
Apache 2.2
MySQL 5.1

Here i place a very short step by step instruction for how to do so.

1. Go to and download needed php version.

2. Extract just downloaded file: shell> tar xzvf php-5.2.17.tar.gz

3. Install PHP development libraries:
as root:
shell> apt-get update
shell> apt-get install libxml2-dev libmysqlclient-dev libcurl4-gnutls-dev libcurl4-openssl-dev libpng12-dev libjpeg62-dev

4. go to the folder where you extracted PHP archive

5. configure and make it:
shell> ./configure --prefix=/opt/php5.2 \
--with-config-file-path=/opt/php5.2 \
--with-mysqli \
--with-pdo-mysql \
--with-mysql \
--with-curl \
--with-gd \
--with-jpeg \
--with-jpeg-dir \
--with-xsl \
--with-zlib \
--enable-cli \
--enable-fastcgi \
--enable-discard-path \
shell> make
shell> make install

6. Install and set up fastcgi support for PHP:
shell> apt-get install libapache2-mod-fastcgi

7. Enable fastcgi:
shell> a2enmod fastcgi

8. Enable mod_actions:
shell> a2enmod actions

9. Set up PHP cgi wrapper. Create file '/usr/lib/cgi-bin/php52-cgi' with the following content:
export PHPRC
exec /opt/php5.2/bin/php-cgi
10. Make this file executable:
shell> chmod +x /usr/lib/cgi-bin/php5-cgi

11. Create include file for Virtual Hosts: '/etc/apache2/php52.conf'

12. Fill it in with the following content:
#include for virtual hosts that need to run php-5.2
<FilesMatch "\.php">
   SetHandler application/x-httpd-php5
ScriptAlias /php52-cgi /usr/lib/cgi-bin/php52-cgi
Action application/x-httpd-php5 /php52-cgi
AddHandler application/x-httpd-php5 .php
13. copy php.ini-recommended file to /opt/php5.2/ and rename it to php.ini

14. Include this file in to Virtual Hosts, where PHP2 is needed.
<VirtualHost *.80>

# ...

#needs to run version 5.2.x of PHP
Include php52.conf


15. Restart Apache: /etc/init.d/apache2 restart

That is it.

Thanks to Brett's blog!

Also I invite you to visit us at

Tuesday, July 5, 2011

MBI Solutions website is now multilingual!

Hi, today we added an English version to our website

For this we split the content in to 2 folders: "nl" - for Dutch one and "en" for English.

The only page - index.html remains in the root folder.
To all the pages we added language switcher which cross references corresponding pages.

From the SEO point of view what has been done:
  1. Language tags (see previous post) have been changed to reflect thee new language.
  2. Titles, keywords, descriptions and pages content have been translated
  3. Sitemap file which is used by search engines has been also updated to reflect the changes.
After we uploaded the new website structure we also left there old pages. That is for a while until search engines index the new wesbsite structure. It will be deleted in coming days.

Friday, July 1, 2011

SEO optimization for

Here i'm going to put SEO optimization tips used while optimizing

Generally that's for myself for not to forget it.

1. Don't forget doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

2. <html> tag should look like this:
<html xmlns="" xml:lang="nl" lang="nl">
(MBI Solutions is Belgium website that's why i used "nl" to show that the language of website is Dutch)
Also i added these tags (some manuals recommended to do so):
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="nl" />
<meta http-equiv="language" content="NL" />
<meta name="language" content="nederland" />

3. All pages must contain title, keywords and description meta tags. They should look like this:
<title>MBI Solutions</title>
<meta name="keywords" content="MBI Solutions, software, web-site, internet, Belgium, software ontwikkeling" />
<meta name="description" content="MBI Solutions. Vaste Project prijzen. Professioneel en flexibel. Bespaar tot 50%. Social media. Verhogen klantwaarde. Klantgericht." />
Title will be shown in the browser's headr
Keywords should contain key words describing this page (not whole website!)
Description should contain a short explanations, examples of what this page is about.
!!The most important!!: words which you put in to title, keywords and description must appear in the page content. Better if they appear there not once.

4. All images on pages must have ALT tag filled in. you should put there short description of what is shown on the image. Also the names of images should also men something. For example:
<img src="img/office.jpg" width="296" height="182" alt="MBI Solutions office foto" />
Here the name of the immage says that it's an office photo and the same is mentioned in the image alt tag.