There is no straight forward method for 301/302 URL redirection as we did with rewrite rule. But there are some situations where we need to redirect a URL on a host to some URL on different host. In this situation we need to use 301/302 redirection. There are two ways we can implement this.
First method […]
PHP's archives
URL Redirecting (301,302) in Varnish
Tags: 301, 302, error, rewrite, url redirection, varnish, vcl
How to Log or mail Errors in PHP Code
There are a number of things that can go wrong in code and they bound to through errors, even if you’ve tested them hundreds of times. PHP provides some error handling methods such as error_reporting(), set_error_handler(), error_log(), restore_error_handler() for handling errors in the PHP code.
error_reporting - Sets which PHP errors are reported.
int error_reporting ([ int […]
Installing Symfony Framework in Ubuntu
Install these packages with apt:
php5
php5-cli
php5-dev
php5-sqlite
php-pear
$ sudo apt-get install php5 php5-cli php5-dev php5-sqlite php-pear
Test if Apache and PHP are up and running typing in the browser:
http://localhost/
You should see something like:
Apache/2.0.55 (Ubuntu) PHP/5.1.2-1ubuntu1 Server at localhost Port 80
From the command line, as root:
$ sudo pear upgrade PEAR
$ sudo pear channel-discover pear.symfony-project.com
Edit /etc/php5/cli/php.ini and change the line:
memory_limit = […]
How to setup Memcached server
Introduction
Memcached is a high-performance, distributed caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in memory to reduce the number of times the database must be read.
Installing memcached
shahid@shahid-laptop:~$ sudo apt-get install memcached
shahid@shahid-laptop:~$ sudo apt-get install php5-memcache
After installing these two packages next step is to configure memcached.conf file. […]
Background Process or a Deamon Process using PHP
Process Control Functions (PCNTL)
Introduction
Process Control support in PHP implements the Unix style of process creation, program execution, signal handling and process termination. Process Control should not be enabled within a web server environment and unexpected results may happen if any Process Control functions are used within a web server environment.
Requirements […]
Continue reading " Background Process or a Deamon Process using PHP "
Google Maps API
What is the Google Maps API?
The Google Maps API lets you embed Google Maps in your own web pages with JavaScript. The API provides a number of utilities for manipulating maps (just like on the shahidz.com/map.php web page) and adding content to the map through a variety of services, allowing you to create […]
Favicon icon in the address bar
To show icon on the address bar use html tag
Syntax
<link rel=”shortcut icon” href=”URL” type=”image/ico” />
Example
<html>
<title> Icon in address bar </title>
<link rel=”shortcut icon” href=”image/favicon.ico” type=”image/ico” />
</html>
Installing PHP and PHP modules in Linux
In Redhat and Fedora you can use the command ‘yum’
yum -y install php
yum -y install php-devel
yum -y install php-gd
yum -y install php-imap
yum -y install php-ldap
yum -y install php-mysql
yum -y install php-odbc
yum -y install php-pear
yum -y install php-xml
yum -y install php-xmlrpc
yum -y install curl
yum -y install curl-devel
yum -y install perl-libwww-perl
yum -y install ImageMagick
yum -y install libxml2
yum […]
Continue reading " Installing PHP and PHP modules in Linux "
Search
My MobSpace
More About The Site
Tags
- all Amazon Apache asp autobench background process backup backups catch all catchall cleaning directories deamon digital certificate error favicon fuse google map API Google Map Key httperf http testing image in address bar Iptables Linux mail server mono mount mysql backups mysqldump mysqlhotcopy openload pcntl performance testing PHP php-modules php installation postfix rsync S3-Backup s3fs Shell Script ssh-key ssh-keygen teapop varnish
Categories
- Linux (35)
- Linux Commands (4)
- PHP (8)
- Micellanious (11)
- Mysql (4)
- Shell Script (2)
- Solaris (1)
- Apache (6)
- Tips & Tricks (7)
- Securities (1)
- Iptables (3)
Archives
- October 2008 (2)
- September 2008 (2)
- August 2008 (1)
- July 2008 (4)
- June 2008 (10)
- May 2008 (5)
- April 2008 (2)
- March 2008 (6)
- February 2008 (7)
















