All About PHP Extensions

Pear (PHP Extension and Application Repository) packages are 100% php code. They are just PHP codes that are structured based on Pear’s standards and that are  deposited in a local directory and referenced in php.ini.

PECL packages are php extensions and need to be compiled and the resulted .so files must be deposited in the extensions directory (extension_dir in php.ini).

When you run a command such as

yum install php5-gd

or

apt-get install php5-gd

The dynamic shared library file (.so) is generated and installed for you automatically.

Pear
http://pear.php.net/manual/en/

PECL
http://pecl.php.net/packages.php

Introduction to extension writing
http://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/

Wrapping C++ Classes in a PHP Extension
http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/

phpize info
http://us.php.net/manual/en/install.pecl.phpize.php

Writing Php Extensions http://www.tuxradar.com/practicalphp/20/0/0

About php extensions
http://www.boutell.com/newfaq/creating/phpextensions.html

PHP Coding Standards
http://pear.php.net/manual/en/standards.php 

The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match your running kernel

uname -a

is returning the right version 3.2.0-30-generic however the vmware tools script is complaining.

Solution to create a couple of symlinks

ln -s /lib/modules/3.2.0-30-generic/build/include/generated/utsrelease.h /lib/modules/3.2.0-30-generic/build/include/linux/utsrelease.h

ln -s /lib/modules/3.2.0-30-generic/build/include/generated/autoconf.h /lib/modules/3.2.0-30-generic/build/include/linux/autoconf.h

Then run the vmware perl script again

/vmware-install.pl 

How to Increase a Volume Group Size Linux LVM

Everytime I step away from linux when i get back this LVM stuff always look like chinese to me. So i decided to write this post to remind me of the steps. Hopefully it will help somebody else out there.

First of all, the Volume Group LVM is handled by software, it is an abstraction layer between the operating system and the file system. To increase the Volume Group Size is like adding another partition to your system and have the LVM software pick it up. The OS sees all these added partitions as one and it does not care since it communicates with the drives via the LVM software. Now if one these partitions/drives goes bad, you are in deep sh?? since the operating system spread the files through them just like they were just one single drive.

For the sake of this tutorial let say you have the following scenario:

You have a system with a lvm partition of 10G. Within this partition you have two LOGICAL VOLUMES : the root partition and the swap partition. You realize that the 10G is not sufficient for your operating system and you want to increase it. What should you do?

1. The first thing is to add storage to the system

Let’s say you add a new 50G hard drive or you extend your VM drive by 50G or you use another free partition scattered on your system.

2. Step #2 is to add that drive to the volume group by creating a PHYSICAL VOLUME

Again it is all software. Here is the command:

pvcreate /dev/xdax

replace the x’s by hda2 or sda2 for example.

3. Now you have to extend the volume group to the added size

Here is the command:

vgextend /dev/VolG1 /dev/xdax

Once your volume group is extended, the next thing is to augment your root partition to part of 50G or to the full 50G.

lvresize -L +20G /dev/VolG1/root

I have just added 20G to my root partition.

We are not done yet.
Now we need to expand the logical root partition to the added 20G.
Here is the command:

resize2fs -p /dev/VolG1/root

Now you are done.
The root partition has been increased by 20G. Since we added 50G we still have 30G left that we can use for other purposes. We did not have to reboot the system. We can keep adding disk until we reach the system limitation.

Reference
http://www.howtoforge.com/logical-volume-manager-how-can-i-extend-a-volume-group

LVM manual
http://tldp.org/HOWTO/LVM-HOWTO/index.html

Expand The virtual Machine Disk
http://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-expanding-the-virtual-machine-disk/