Source Guardian installation

 

We are running PHP 5.6 and Apache 2 on our test system. Lets see how we can install and configure this extension there.

First of all, go to /usr/src directory by running the following command:

cd /usr/src/

Here create a new directory named “loader” by running the following command.

sudo mkdir loader

Now go into this newly created directory.

cd loader

And download Source Guardian tar file here.

 

For 32bit system:

sudo wget http://www.sourceguardian.com/loaders/download/loaders.linux-i386.tar.gz

For 64bit system:

sudo wget http://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz

As soon as the file has been download, extract it by running the following command:

tar vxf loader*.tar.gz

extract loader

That’s all, Now we need to copy the loader configuration file to PHP extenstion directory. Please note that if your PHP version is different, then you might have different folder/file name, run command accordingly.

sudo cp ixed.5.6.lin /usr/lib/php5/20131226/

Create a file for sourceguardian inside PHP5 mod’s directory i.e. /etc/php5/mods-available/, run following command to create file.

sudo gedit /etc/php5/mods-available/sourceguardian.conf

It will create an empty file in GEdit text editor, paste following content in this empty file. [Change your path or file names in case you are using different version of PHP]

[sourceguardian]

zend_extension=/usr/lib/php5/20131226/ixed.5.6.lin

Gedit add extension

Save the file and return back to the terminal windows. Run following command to enable this extension.

php5enmod sourceguardian

We are almost there, restart apache web server by running the following command:

sudo /etc/init.d/apache2 restart

Congratulations, SourceGuardian has been installed and enabled for your PHP now :)

In order to verify it, we need to see the output of phpinfo() function. Go to /var/www/html directory by running the following command.

cd /var/www/html

Create an empty file here, named phpinfo.php by running the following command.

sudo gedit phpinfo.php

And paste following code in this file.