Archive for the ‘PHP’ Category

  • htaccess to stop files listing & executing any file inside folder

    Tuesday, July 13th, 2010

    # htaccess to stop files listing on folder and stop executing any file inside folder like config.ini file etc which are not need to display in the browser IndexIgnore */* (It will stop files listing for specific folder) # deny access to all files of folder Order allow,deny Deny from all Satisfy All Forbidding a [...]

  • PHP 5.3 ,MySql 5.1 on RHEL 4

    Tuesday, July 6th, 2010

    For those who are still using RHEL 4.x and in need of deploying PHP 5.3 & MySQL 5.1 , you can get the required rpm packages from http://rpms.famillecollet.com/enterprise/4/ You can add the repo and update php and MySQL packages via yum, or download and install manually. I think the bare minimum will require these packages [...]

  • Optimize and Tweak High-Traffic Servers

    Wednesday, June 30th, 2010

    Summary If you are reaching the limits of your server running Apache serving a lot of dynamic content, you can either spend thousands on new equipment or reduce bloat to increase your server capacity by anywhere from 2 to 10 times. This article concentrates on important and poorly-documented ways of increasing capacity without additional hardware. [...]

  • Tool for automatically creating the basic framework for a PHP module

    Friday, June 25th, 2010

    WHAT IT IS It’s a tool for automatically creating the basic framework for a PHP module and writing C code handling arguments passed to your functions from a simple configuration file. See an example at the end of this file. HOW TO USE IT Very simple. First, change to the ext/ directory of the PHP [...]

  • WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.

    Tuesday, June 15th, 2010

    I am getting this error “configure: WARNING: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.” while i tried to install json support with PHP 5.1.6 What is re2c? re2c is a tool for writing very fast and very flexible scanners. Unlike any other such tool, re2c focuses on generating [...]

  • Loading CSV File into Mysql database

    Monday, May 3rd, 2010

    LOAD DATA  LOCAL INFILE ‘/home/user/www/upload/upload.csv’ INTO TABLE smstobesent  FIELDS TERMINATED BY ‘,’ LINES TERMINATED BY ‘\\n’ (name,contact_no) $file_name=/home/user/www/upload/upload.csv Load csv file into database using php script $rs=mysql_query(“LOAD DATA  LOCAL INFILE ‘$file_name’ INTO TABLE smstobesent  FIELDS TERMINATED BY ‘,’ LINES TERMINATED BY ‘\\n’ (name,contact_no)”) or die(“Error in Load File: “.mysql_error()); I had tried to run  command [...]

  • Turck MMCache for PHP

    Tuesday, April 20th, 2010

    Introduction: Turck MMCache is a free open source PHP accelerator, optimizer, encoder and dynamic content cache for PHP. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated. We sho Turck MMCache is a free open source PHP accelerator, optimizer, encoder and dynamic [...]

  • How to install mod_gzip

    Tuesday, April 20th, 2010

    Introduction:- I recently needed to speed up the load time of one of my websites, Ramprage.com – a popular sports website, while I didn’t want to change the content itself I could change how fast it was delivered with mod_gzip. This tutorial features dynamic integration of mod_gzip with Apache, no recompile necessary. mod_gzip is an Internet [...]

  • COLUMNS Partitioning in Mysql 5.5

    Sunday, April 18th, 2010

    Introduction:- COLUMNS Partitioning  in Mysql 5.5 New   partition type COLUMNS Partitioning is introduced   in  MySQL 5.5 beta released in the MySQL Conference 2010 Columns Partitioning is extension of the list and range partition introdued in the MySQL 5.0 (  http://onaxer.com/blog/?p=108) Major Feature of the Column Partitioning 1)    It allows use of multiple columns to be [...]

  • Permission denied trying to install PECL module

    Saturday, April 17th, 2010

    [root@server memcache-2.2.5]# phpize && ./configure –enable-memcache && make && make install ; Configuring for: PHP Api Version:         20041225 Zend Module Api No:      20050922 Zend Extension Api No:   220051025 /usr/bin/phpize: /tmp/memcache-2.2.5/build/shtool: /bin/sh: bad interpreter: Permission denied Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this [...]

  • Memcached with php

    Saturday, April 17th, 2010

    Introduction: memcached (pronunciation: mem-cash-dee) is a general-purpose distributed memory caching system that was originally developed by Danga Interactive for LiveJournal, but is now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source [...]

  • How to build rpm for http with mpm worker (on x86_64)

    Saturday, April 17th, 2010

    Introduction: The Apache HTTP Server is designed to be a powerful and flexible web server that can work on a very wide variety of platforms in a range of different environments. Different platforms and different environments often require different features, or may have different ways of implementing the same feature most efficiently. Apache has always [...]

  • Compile php with mbstring

    Saturday, April 17th, 2010

    You can add mbstring in the php during compiling php and during compilation please add –enable-mbstring, please details compile time options below: ./configure –enable-ftp –enable-gd-native-ttf –enable-safe-mode –enable-shmop –enable-mbstring –enable-soap –enable-sockets –enable-sysvmsg –enable-sysvsem –enable-sysvshm –prefix=/home/user/dev/php –with-config-file-path=/home/user/dev/php –with-curl –with-freetype-dir=/downloads/freetype-2.1.10 –with-gd –with-jpeg-dir –with-ldap –with-mysql –with-openssl –with-xsl –enable-mbstring –with-zlib –with-zlib-dir=/usr/lib Thanks Manoj Chauhan

  • Load balancing with Varnish

    Sunday, April 11th, 2010

    Introduction:- Varnish has a built in load balancer. Use this if you have more then one origin server. Using this is quite easy. You start up by declaring more then one backend server. We add a probe object to each backend to let varnish check the health of the objects. {{{ backend foo {   [...]

  • Steps to install memcache server

    Sunday, April 11th, 2010

    Introduction:- curl -O http://www.monkey.org/~provos/libevent-1.1a.tar.gz tar xfz libevent-1.1a.tar.gz cd libevent-1.1a ./configure && make && make install curl -O http://www.danga.com/memcached/dist/memcached-1.1.12.tar.gz tar xfz memcached-1.1.12.tar.gz ./configure && make && make install yum install libevent useradd memcached password = weareglam mkdir /var/run/memcached && chown memcached:memcached /var/run/memcached memcached -d -p 11211 -u memcached -m 1024 -c 1024 -P /var/run/memcached/memcached.pid to check [...]