How to fix “Headers already sent” error in PHP

PHP-Logo-Wallpaper

The long term answer is that all output from your PHP scripts should be buffered in variables. This includes headers and body output. Then at the end of your scripts do any output you need.

The very quick fix for your problem will be to add

as the very first thing in your script if you only need it in this one script. If you need it in all your scripts add it as the very first thing in your header.php file.

This turns on PHP’s output buffering feature. In PHP when you output something (do an echo or print) if has to send the HTTP headers at that time. If you turn on output buffering you can output in the script but PHP doesn’t have to send the headers until the buffer is flushed. If you turn it on and don’t turn it off PHP will automatically flush everything in the buffer after the script finishes running. There really is no harm in just turning it on in almost all cases and could give you a small performance increase under some configurations.

If you have access to change your php.ini configuration file you can find and change or add the following

This will turn output buffering out without the need to call ob_start().

To find out more about output buffering check out http://php.net/manual/en/book.outcontrol.php

Continue reading How to fix “Headers already sent” error in PHP

 

How to Install Laravel 5 and Laravel 4(Windows + Wamp)

laravel-2

Installing Procedures of Laravel Version 5 and Version 4 on WAMP :

1. Enable OpenSSL

OpenSSL must be enabled in the PHP configuration.

Edit php.ini in your WAMP’s PHP folder, e.g.:

Note: This is not the php.ini in C:\wamp\bin\apache\Apache2.4.4\bin.

Find the following line and remove the semicolon save it:

;extension=php_openssl.dll changed to extension=php_openssl.dll

2. Install Composer

(i).Download the Composer Windows installer from getcomposer.org.

(ii). Run the installer.

(iii). When it asks for the location of php.exe, point it to the executable in your WAMP’s PHP folder, e.g.:

(iv). Finish the installation.

(v). Open a command-line interface (cmd) and type:

It should return a list of options. If you get an error, restart your computer and try again.

Composer has now been installed and added to your PATH environment variable. This means you can run it from any directory using the command-line interface.

Now we need to install Composer. This is a dependency manager that will download the latest release of Laravel and specific versions of Laravel’s dependencies, such as Doctrine and Symfony.

3.Install Laravel

Now that Composer has been installed, Composer can download and install Laravel onto your system.

(i). Open a command-line interface (cmd).

Continue reading How to Install Laravel 5 and Laravel 4(Windows + Wamp)

 

laravel-4.2-with-Auth-CRUD

github-1Laravel-4.2-with-Auth-Crud is a learning module which have authentication (log in and log out) and Complete CRUD(Create,Read,Update and Delete) example.

github Link : https://github.com/saidurcse/laravel-4.2-with-Auth-Crud

Laravel-4.2-with-Auth-Crud

Laravel-4.2-with-Auth-Crud is a learning module which have authenticaton (log in and log out) and Complete CRUD(Create,Read,Update and Delete) example.

Prpcedures to use

Step 1: Get the code

Option 1: Git Clone : $ git clone https://github.com/saidurcse/Laravel-4.2-with-Bootstrap.git

Option 2: Download the repository : https://github.com/saidurcse/Laravel-4.2-with-Bootstrap-master.zip

Step 2: Configure Database

Option 1: Configure the following file app/config/database.php

Step 3: Load the database from db folder.

License

The Laravel framework is open-sourced software licensed under the MIT license

 

HTML5 CSS3 Tutorial

 

Basic links that will be helpful for learning HTML5 and CSS3 . What I have found very helpful for me that I am sharing with you.

1 ) My First choice will go for my favorite tutorial website that is  W3Schools .

HTML(5) Tutorial  at W3Schools.With HTML you can create your own Web site.This tutorial teaches you everything about HTML.HTML is easy to learn – You will enjoy it.

Save a lot of work with CSS!In our CSS tutorial you will learn how to use CSS to control the style and layout of multiple Web pages all at once.CSS Tutorial at W3Schools.

2) My Second choice will for my favorite project tutorial website that is CodeProject.The below links will help any person who wants to learn alone at home html5 and css3.

Beginner’s Guide to HTML5 CSS3 – Building the Basics

HTML5 Quick Start Web Application

Beginner’s Guide to HTML5/CSS3 – Part 1 of 12

3)Another important website for all web development lovers is Codecademy.

It’s almost like a university course, only you control when and where class happens. Codecademy’s beginning web development course walks you through the basics of HTML and CSS, giving you projects throughout to practice newly learned skills. And once you’ve mastered the fundamentals, it’s easy to launch into a new course on a more specialized skill, such as PHP, JavaScript or Python.

 

 

Laravel-4.2-with-Bootstrap

Laravel-4.2 with Bootstrap is a package which can be used as a starter point.

github Link : https://github.com/saidurcse/Laravel-4.2-with-Bootstrap

Purpose

It will make easier for developer who want to use Bootstrap as their front end tool. It is a package of Laravel-4.2-with-Bootstrap-3.3.1.

Installation

 

1. Install Composer

Laravel utilizes Composer to manage its dependencies. First, download a copy of the composer.phar. Once you have the PHAR archive, you can either keep it in your local project directory or move to usr/local/bin to use it globally on your system. On Windows, you can use the Composer Windows installer.

Continue reading Laravel-4.2-with-Bootstrap

 

Necessary git commands for github project

Major GIT commands with examples

Here you will find a list with the major commands, their short descriptions and exemplary usage. For a detailed description of all the GIT commands please visit   http://gitref.org/index.html  or  https://help.github.com/articles/set-up-git/ .

Major GIT commands:

  • git config
    Sets configuration values for your user name, email, gpg key, preferred diff algorithm, file formats and more. Example: git config –global user.name “My Name” git config –global user.email “user@domain.com” cat ~/.gitconfig [user] name = My Name email = user@domain.com
  • git init
    Initializes a git repository – creates the initial ‘.git’ directory in a new or in an existing project. Example: cd /home/user/my_new_git_folder/ git init
  • git clone
    Makes a Git repository copy from a remote source. Also adds the original location as a remote so you can fetch from it again and push to it if you have permissions. Example: git clone git@github.com:user/test.git
  • git add
    Adds files changes in your working directory to your index. Example: git add .
  • git rm
    Removes files from your index and your working directory so they will not be tracked. Example: git rm filename
  • git commit
    Takes all of the changes written in the index, creates a new commit object pointing to it and sets the branch to point to that new commit. Examples: git commit -m ‘committing added changes’ git commit -a -m ‘committing all changes, equals to git add and git commit’
  • git status
    Shows you the status of files in the index versus the working directory. It will list out files that are untracked (only in your working directory), modified (tracked but not yet updated in your index), and staged (added to your index and ready for committing). Example: git status # On branch master # # Initial commit # # Untracked files: # (use “git add <file>…” to include in what will be committed) # # README nothing added to commit but untracked files present (use “git add” to track)

Continue reading Necessary git commands for github project

 

Most Popular WordPress Plugins

 

Contact Form 7

Just another contact form plugin. Simple but flexible.

  • Version 4.1
  • Updated 2015-1-26
  • Downloads 23,936,669
  • Average Rating
    4 stars

Akismet

Akismet checks your comments against the Akismet Web service to see if they look like spam or not.

  • Version 3.0.4
  • Updated 2014-12-11
  • Downloads 27,892,268
  • Average Rating
    4 stars

All in One SEO Pack

All in One SEO Pack is a WordPress SEO plugin to automatically optimize your WordPress blog for Search Engines such as Google.

  • Version 2.2.5.1
  • Updated 2015-1-30
  • Downloads 21,693,385
  • Average Rating
    3 stars

Continue reading Most Popular WordPress Plugins

 

Move WordPress From Local Server to Live Site

move-wpFor a while now, WordPress has been my favorite option for providing clients with a Content Management System. And since the release WordPress 3, it’s become the easiest sale on the planet. After showing them a demonstration, 75% of the time, the client loves it, and it persuades them to pay double the price they would have paid for a generic ol’ static website. It’s amazing how much WordPress 3’s menu builder has had such an impact on the entire software and the overall presentation of it. Continue reading Move WordPress From Local Server to Live Site