Confiuring php from source

There are few steps if you want to compile and configure php from the source code available on php.net website.
1. Download the source code from the site.
2. unzip it to a directory of your choice [for eg. /home/uttam/].
3. go to your shell prompt.
4. run configure with the extension needed to support in php.[for eg. ./configure --with-mysql]
- you may see this type of error while configuring your php.

configure: error: xml2-config not found. Please check your libxml2 installation.
- In this case install libxml2 by using sudo apt-get install libxml2 libxml2-dev



5. You will get a thank you message for using php.
5. run make
6. run make install using command sudo make install.here you will see the following info which tell you directory info of PHP .
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/man/man1/
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/

7. By default PHP command will be loaded at /usr/local/bin/php directory.you can use /usr/local/bin/php -m to know options and extention available to use with php.

8. Congratulation you have successfully installed PHP.