• Home
  • Knowledgebase
    • Technology
      • Video Technology
      • PHP
      • MySQL
      • WordPress
      • Cloud Computing
  • Thoughts
    • General
    • Stories
    • Places
    • Workplace
    • Social Issues
    • Reviews
  • Quotes
  • About
  • Contact

Kamalika's Notebook

thinking nothing...............!!

HTTP Status Codes

April 19, 2015 By Kamalika 2 Comments

What is Http?

As per Wikipedia definition… “The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web. Hypertext is structured text that uses logical links (hyperlinks) between nodes containing text.”

Whenever a request is made to a server for any page (webpage) of any website an HTTP status code is the response to the request. A request is made when a search engine crawler (like Googlebot) crawls the page or a user tried to open the page in a web browser.

This status code provides the information about status of the request. Some of the common status codes are:

  • 200 – The server successfully processed the request. Generally, this means that the server provided the requested page
  • 301 – The page is permanently moved
  • 404 – The requested page doesn’t exist
  • 500 – Internal server error

HTTP Status codes are always three-digit numbers. The first digit of status code begins with one of five numbers, 1 through 5. From the 100s through the 500s, status codes are divided into following categories:

  • 100s – Informational: Request has been received and the process is continuing
  • 200s – Success: Request was received and processed successfully
  • 300s – Redirection: Request has been received, but needs to perform an additional step to complete the request
  • 400s – Client Error: Request was made by the client, but the page is not valid
  • 500s – Server Error: Valid request was made by the client, but the server failed to complete the request

Below I have shared a few learning resources on HTTP Status Codes:

  • Wikipedia: http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
  • IETF: http://www.ietf.org/assignments/http-status-codes/http-status-codes.xml
  • W3C: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  • REST API: http://www.restapitutorial.com/httpstatuscodes.html

HTTP Status Code and PHP

PHP has a function http_response_code which gets or sets the HTTP Response / Status Code.

If you pass no parameters then http_response_code will get the current status code. If you pass a parameter it will set the response code.

[php]

<?php

http_response_code(404);

echo http_response_code();

?>

[/php]

The above code will first set the http status code to 404 and then print the current status code, i.e., 404.

Please note that this http_response_code was introduced in PHP 5.4.

Filed Under: Apache, HTTP, Technology Tagged With: Cloud Architect Mumbai India, http, http status codes, Tech Consultant Mumbai India

Installing LAMP in Centos 6.3

May 20, 2013 By Kamalika Leave a Comment

LAMP is the abbreviation of Linux, Apache, MySQL, PHP. In this article I’ll try to explain how you can install an Apache2 webserver on a CentOS 6.3 server with PHP5 support (mod_php) and MySQL support. This approach should work if you start from scratch, i.e., the server has only CentOS 6.3 installed and nobody ever tried to install or configure LAMP!

Caution! This article is meant for those who rarely have to work on such projects when no expert advice / support available!  By no means this should be used by any Linux Pro.

Introduction

While deploying Centos 6.3 onto the server please put hostname as localhost, and don’t bind the server to any particular IP address.

Pages: 1 2 3 4 5

Filed Under: Apache, CentOS, CentOS 6.3, LAMP, Linux Servers, MySQL, PHP, Technology Tagged With: Apache, LAMP, Linux, MySQL, PHP

Connect with me online

  • Facebook
  • Google+
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Hello There…

Hi, I'm Kamalika... a newbie entrepreneur & business coach, technology enabler, mentor, hobbyist photographer, YouTube, Netflix, Audible & Kindle indulgent, food enthusiast, Starbucks fan and former Disney employee. ...please click here to know more about me (only if you are interested!…

Follow my notebook

Enter your email address to follow my notebook and receive notifications of new posts by email.

Looking for something?

Copyright © 2019 · Kamalika Guha Roy