Skip to main content

Posts

Getting Started with Nginx and PHP-FPM

Nginx , a HTTP and reverse proxy server, known for its blazing speed in serving static files, including grand performance in terms of serving up FastCGI pages makes for a great coupling with the upcoming  PHP-FPM  sapi in PHP (It is currently in the 5.3 branch and previously was a patch) offer a great solution for finally getting rid of that old sloppy mod_php in Apache. Do you have the same issue where your apache instances have started to run too large? This might be the time to start to move forward. A little background on why I have endeavored on this path. While running Apache at several jobs and institutions it simply became clear that under heavier traffic loads having all of the ridged custom components of Apache were starting to slow things down. To the point of large instances running sometimes up to 300MB in size. Having this size just to get a simple image or PHP page was just not necessary as well as proved to be a performance bottleneck. While the first po...

How to use Memcache with PHP

Memcache with PHP Today I have new article for PHP. Last time I did post about  Memcache with PHP . Today we will talking about caching in PHP again. I will show you how you can use  Memcache in PHP . We will prepare useful class for working with Memcache for us and several examples. Memcache itself providing procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications. I don`t have online demo for today, just because haven`t installed Memcache at our hosting. But I will include samples of using our new library in this article too (as I did for our previous APC-related post). Also, pay attention that Memcache extension not bundled with PHP by default. This extension available in PECL.  Step 1. PHP I made this useful class for you. We will use this class to working with memory using Memcache system. classes/memcache.caching.php oCache = new Memcache(...

Step By Step Guide To Install Memcache On Linux

This post is more like a note to me, so that in future I can look up for steps involved in installing  memcache  on Linux servers like Centos or RHEL. Those of you who  follow me on twitter , will know that me and my friends spends hours trying to install memcache on one of our web server. Normally this is a five minute job, but unfortunately for us those tricks did not work out. So if you have tried YUM and APT-GET and still could not install the memcache then read on, to find the alternate( read manual, without magic ) way of doing it. When we talk about Memcache their two things that needs to be installed Memcache Daemon  know as memcached, and Memcache client  for your programing language, in this case PHP. Installing Memcache Daemon Note these steps has been taken from http://in2.php.net/manual/en/memcache.installation.php Steps to install Libevent(memcached dependency) First we need to check if libevent is installed or not? type...

Migrating from MS Access (*.mdb,*.accdb) To MySQL database

This article describing how to use ESF Database Migration Toolkit to migrating data from MS-Access 2000-2007 to MySQL database and vice versa. Introduction: If you have not installed ESF Database Migration Toolkit,  get it now . 1).  In "Choose a Data Source" dialog, choose "Microsoft Access (*.mdb)" or "Microsoft Access 2007 (*.mdb;*.accdb)" if you are migrating data from Access 2007; Then press "Browse" to find the Access MDB (or ACCDB) file, if the file has a password, fill out password in "Password" field, then click "Next" to continue. 2).  In "Choose a Data Destination" dialog, choose "MySQL Database", fill out the server name where MySQL locating and the server port (default is 3306), plus, you want to offer a username and password to connect it. MySQL supporting some different Storage Engines, please click  here  to get more information about MySQL Storage Engine. In "CharacterSet" ...

Creating simple, extendible CRUD, using Zend Framework

The Form Creating a nice, easy to maintain form, starts with a form class. Creating your forms procedurally in your controller/actions is horrid. please don’t do it. To start with creating your form classes, you need your own namespace in your library. If you don’t have this, register one. This can be done by adding an _initAutoloading method to your Bootstrap. below is a short example. its not comprehensive (you can also do this in your ini i believe, but I use php configuration files similar to DASPRiD ‘s, and i’m not trying to show how to set up autoloading here.) class Bootstrap extends Zend_Application_Bootstrap { //... /** * Initilise autoloader and library namespaces */ public function _initAutoloading ( ) { $loader = Zend_Loader_Autoloader :: getInstance ( ) ; $loader -> registerNamespace ( 'My_' ) ; } //... } Your next task, create a form. This is pretty simple. I will demonstrate us...