Knowledgebase: VisiChat Installation
PHP Configuration
Posted by VisiChat Hosting, Last modified by VisiChat Hosting on 17 February 2015 11:53 AM

You must ensure your PHP installation has the following components installed: PHP GD library, PHP cURL library, PHP MySQL library and ionCube Loader. Three PHP variables must also be modified to allow Visichat to function as expected. First we will look at how this can be accomplished in CentOS, and the instructions will be similar for other Linux distributions.

The only substantial difference being the package manager syntax on your chosen platform. On Windows, graphical binary installation packages are normally available. PHP variable manipulation is discussed at the end of the page. Before you start, please make sure you are logged into your server as the root user. The terminal should greet you with something like this.

[root@yourservername]#

Checking installed PHP components

To see what PHP components are already present, type or copy and paste the following line - bold text - into the terminal prompt.

[root@yourservername]# rpm -qa | grep php

After you hit enter, you'll see something similar to the output below.

[root@yourservername]# rpm -qa | grep php
php-common-[version]
php-cli-[version]
php-[version]
php-pdo-[version]
php-mysql-[version]

Where [version] corresponds to a numeric value representing the PHP version you have on your system. If PHP GD, PHP cURL and PHP MySQL are already in the list, then you won't have to install them manually. To see if ionCube is already present, use the following command.

[root@yoursername]# php -i | grep ionCube

If one or more modules aren't present, see appropriate subsections below for installation instructions.

Installing PHP GD library

Please enter the following command in the terminal to fetch the GD library using yum.

[root@yoursername]# yum install php-gd

Yum will do what it needs to do to fetch the required packages and resolve required dependencies. You may see quite a bit of text output - that's fine. All you have to do is enter 'y', when asked 'Is this ok[y/N]:', as illustrated in the box below.

Transaction Summary
=================================
Install      1 Package(s)
Update       5 Package(s)
Remove       0 Package(s)
Total download size: 3.7 M
Is this ok [y/N]: y

That's it. Just sit back and wait for the installation to finish.

Installing PHP cURL library

The command below will download and install the PHP cURL extension.

[root@yoursername]# yum install php-curl

Installing PHP MySQL library

As before, type the words in bold on the terminal prompt.

[root@yoursername]# yum install php-mysql

Modifying PHP Variables

PHP variables are stored in the php.ini configuration file. To modify them, you will have to edit this file. PHP info command can be used to locate the php.ini file on your system.

[root@yourservername]# php -i | grep 'Configuration File'

The output will look something like this. By default php.ini is stored in the /etc/ directory, as shown.

Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

Edit the file using your preferred command line text editor, such as vi. You can find the manual for vi editor here: http://unixhelp.ed.ac.uk/vi/ or type man vi from the terminal.

[root@yourservername]# vi /etc/php.ini

In the file you need to find and change the following variables. They will have default values set, but please change these to values highlighted in bold below.

max_post_size = 10M
upload_max_filesize = 10M
memory_limit = 32M

Save and close the file, and restart your web server.

Installing OpenSSL

Installing OpenSSL on Windows

OpenSSL is an open-source library that implements the standard SSL and TLS secure communication protocols, and exposes basic cryptographic functions to your system. Plenty of other things depend on it. Unfortunately, even though the library is cross-platform, it is not always present in Windows systems.

First check if OpenSSL is already present: search the Windows folder for libeay32.dll and ssleay32.dll libraries. Specifically:

C:\Windows\system32

If they are not present - proceed with the installation steps.

Step 1 Grab the installer for your version of Windows or Windows Server here.

Step 2 Run the installer, and double check that the libraries mentioned above have been successfully installed.

Alternatively, you may copy and paste the required libraries from your PHP root folder directly into C:\Windows\system32, but the installer route is recommended.

Installing OpenSSL on Linux

This is normally not required, as most recent server distributions come with this component pre-installed.

First, check if the library is already available on your system by running the following command:

[$]>openssl version

If you get something like:

OpenSSL x.x.x [date]

Where x.x.x is a version number and [date] is a calendar date of when the library was compiled; then the library is present and you can skip to configuring the OpenSSL PHP extension instead.

However, if the command returns an error, then fetch the OpenSSL package from your distributions repository. This can be done like so:

Using APT(Debian/Ubuntu/Mint and others):

[$]>apt-get -y install openssl

Using YUM(Red Hat/Cent OS/SuSE and others):

[$]>yum install openssl
After installation is finished, consult the documentation for your distribution to configure OpenSSL and setup the necessary keys and certificates for the first time.

Installing OpenSSL on Mac OS X

Like on Linux, this shouldn't be necessary. First check if the library is installed:

$ openssl version

If there's an error here though, proceed with the installation steps.

Step 1 Download and install MacPorts.

Step 2 Run the following command from the terminal:

$ 'sudo port sync; sudo port selfupdate; sudo port install openssl

You're done.

Configuring OpenSSL PHP extension

Find the php.ini file in your PHP root directory. Open it with a plain text editor like Notepad (or something like nano on Linux).

On Windows find the line (shortcut: CTRL+F) that reads:

;extension=php_openssl.dll

Uncomment it by removing the semicolon (;), so it reads:

extension=php_openssl.dll

Save the file.

On Linux/Mac OS X the extension line you need is slightly different:

;extension=php_openssl.so

It should be changed to:

extension=php_openssl.so

By removing the semicolon as before.

Save the file.

Now restart your web server for the changes to take effect. The OpenSSL PHP extension should now be loaded.

Installing ionCube Loader

Please see the separate tutorial for IonCube Loader Installation.

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).