Tuesday, May 20, 2014

Apache + PHP + Oracle + Linux

It is good to be back. I hope I can be more consistent. Most of my days work centers on the subject of this post.

PHP, Apache, Linux and Oracle. MySQL is the database is use for most of the projects I undertake mainly due to ease of use and also the scale of the projects.

In this post I will be talking about adding Oracle to the list of supported database on  PHP. The operating system on which the setup was done is Open Suse 11 64 bit.

The steps are are follows.

Download instantclient-basic-linux.x64-12.1.0.1.0-1.x86_64.rpm or rpm version and instantclient-sdk-linux.x64-12.1.0.1.0-1.x86_64.rpm header files from www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

Install the rpms.

rpm -ivh instantclient-basic-linux.x64-12.1.0.1.0-1.x86_64.rpm
rpm -ivh instantclient-sdk-linux.x64-12.1.0.1.0-1.x86_64.rpm

The first RPM puts Oracle libraries in /usr/lib/oracle/12.1/client64/lib and the second creates headers in /usr/include/oracle/12.1/client64.

Install header files for php and install gcc

yum install php-devel
yum install gcc

Now install Oracle OCI8 extensions

pecl install oci8

Add the Instant Client directory to apache2 under /etc/sysconfig

cd /etc/sysconfig
vi apache2
add export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib

Restart apache

service apache2 restart

Verify oci8 extention by creating a php file containing the function below

phpinfo();

Tuesday, April 2, 2013

Redhat Enterprise Linux Registration

Its good to be back! I cant remember the last time I wrote anything.

I am a fun of rpm based systems, fedora is my OS of choice. Recently the company i work for purchased a licensed copy of Redhat enterprise linux and my task was to install and ensure that, the latest patches and updates where applied.

The installation was normal if you have installed fedora before, however the update process has completely changed. The normal yum update command yielded no responses. A few googling around enlighten me thus the birth of this post.

Note the procedure below was tested on Redhat enterprise linux 6 and the registration process was command line.

First register you installation with Redhat. One needs to have a customer account with Redhat. It is acquired by purchasing the product from your nearest vendor.

1. subscription-manager register

The above command registers you installation after a correct user name and password have been supplied.

The Next step is to subscript to updates.

2. rhn_register

The above will pup up a wizard which will guide you through the installation. Again one needs to provide a valid user name and password.

Finally execute the update command.

3. yum update

That is all it takes to subscribe to redhat updates through the command line.

Note: one can start from step two and it will still work.

Done!

Sunday, January 2, 2011

How to install fonts in GNOME

Fonts have become and integral part of every system that displays text. For this reason one of the things I do when customizing GNOME is to install my favourite fonts.

Most often I switch to KDE only to install fonts for GNOME via Font Installer.

However this is totally not necessary. These steps should help you install  fonts in GNOME with no effort.

1. Log in to the account where you need the fonts installed.

2. Under your home directory create a hidden folder named fonts.

     i. cd ~

      ii. mkdir .fonts

3. Copy the true type fonts (TTF) you wish to install into this folder.

    i. cp -R ~/myttf/* ~/.fonts.
 
4. Refresh your profile. I prefer a log off.

In order to verify if the fonts are installed, open Open Office Writer and click on the fonts drop down in the format toolbar to see if your newly installed font is in the list.

That's it folks.

Monday, December 13, 2010

SMS Server Tools

For those of us who are facinated about text messaging technologies, the best is yet to come.


This post is about the creation of a modem bank with SMS Server Tools.


Assuming one is able to compile SMS Server Tools, the sample configuration below will help you get started.


# Edited by Lord Kinful

devices = GSM1, GSM2, GSM3, GSM4
failed = /var/spool/sms/failed

[queues]
MTN = /var/spool/sms/MTN

ZAIN = /var/spool/sms/ZAIN
VODAFONE = /var/spool/sms/VODAFONE

TIGO = /var/spool/sms/TIGO

[provider]
MTN = 024,023,025

ZAIN = 026
VODAFONE = 020

TIGO = 027

[GSM1]
device = /dev/ttyUSB0
incoming = yes

pin = 1111
queues = MTN
logfile = /var/log/smsd_mtn.log
loglevel = 7

[GSM2]
device = /dev/ttyUSB2
incoming = yes
queues = VODAFONE
logfile = /var/log/smsd_vodaphone.log
loglevel = 7
#pin = 1111

[GSM3]
device = /dev/ttyUSB1
incoming = yes
queues = ZAIN
logfile = /var/log/smsd_zain.log
loglevel = 7
#pin = 1111

[GSM4]
device = /dev/ttyUSB3
incoming = yes
queues = TIGO
logfile = /var/log/smsd_tigo.log
loglevel = 7

#pin = 1111


The above configuration was created for a PC having four modems attached to it. However depending on the design of ones implementation, the configuration can be modified.


One needs to under stand certain key parameters in the configuration.


1. Devices : it specify the modems attached to the computer.

2. Queues:  these are spool directories for the modems attached.

3. Provider: it specifies the GSM provider being used by the modems attached.


The rest I believe are self explanatory. The queues and the provider goes hand in hand. When one wants to deliver an SMS through a particular modem based on the provider of the receiver, then the queues and provider needs to be used.


To those SMS Server Tools "Lovers" let me hear your thoughts.