Installing Laravel4 in Mac OSX with MAMP

Standard

Re-cap:
In the past and first tutorial of this series we learned how to create a virtual host with MAMP. In this second tutorial, we will install laravel4 PHP framework and will go another step toward developing a full laravel4 application series.

Precautions:

  • Make sure your installed PHP version is greater or equal to 5.3.7
  • Also make sure the MCrypt PHP extension is enabled
  • For pretty URL the mod_rewrite module is enabled on Apache

1. Install Composer Globally:

The following command will just check a few PHP settings and then download composer.phar

$ curl -sS https://getcomposer.org/installer | php

You can run these commands to easily access composer from anywhere on your system

$ sudo mv composer.phar /usr/local/bin/composer

2. Create a laravel project named “thisdayinbangladesh” inside our MAMP’s “htdocs” directory:

Going inside the “htdocs” directory

$ cd /Applications/MAMP/htdocs

Creating the project there

$ composer create-project laravel/laravel thisdayinbangladesh --prefer-dist

3. A small permission issue:

Lets enter into our project directory

$ cd thisdayinbangladesh/

Change the permission of the storage folder to writable

$ sudo chmod -R 0777 app/storage/

4. Basic Configuration:

Update line number 29 of the “app/config/app.php” file to

$ 'url' => 'http://thisdayinbangladesh.dev/',

and line 42 to

$ 'timezone' => 'Asia/Dhaka',

5. Database configuration:
Though configuring database is not necessary to have a first run but lets complete this step as we will not do any editing on the config files later.


'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'thisdayinbangladesh',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
 ),

6. Lets have a test run:

Open the URL of your laravel application as we created earlier using virtual host; on the browser. That is http://thisdayinbangladesh.dev/
You should arrive!

Kohana with Twitter bootstrap: Auto Generator Shell Script

Standard

Kohana HMVC with Twitter Bootstrap Auto Generator

What it does?

  • It makes a ready to develop web app on Kohana MVC along with Twitter Bootstrap UI framework.
  • First it downloads kohana, twitter bootstrap, jquery etc.
  • Secondly it makes necessary changes on the kohana boostrap and allocates UI assets.
  • Then it creates two types of routes for accessing front end and backend of the developing app.
  • It also makes changes on the default controller class and creates a view for it.
  • Also you can create a set of MVC (model, view, controller) classes/files by using create command.
  • Finally you can open the app in browser using open command.

Installation

  1. I assuem you have downloaded the kohanastrap.sh file on your home.
  2. Open up the terminal. Change its permission by chmod +x ~/kohanastrap.sh
  3. Make a symlink of it by sudo ln -s ~/kohanastrap.sh /usr/bin/kohanastrap
  4. Type kohanastrap from inside any directory and talk with it.
  5. I assume, you will enter into yout htdocs OR www directory and type kohanastrap init and then it will build up a ready to develop web app using twitter bootstrap as template.
  6. If you want to create a set of MVC files/classes such as a Controller, a Model and a View for managing users of your app, then type kohanastrap User and Done! Check inside your classes, views directory.
  7. Finally run your web app using the command kohanastrap open and it will open your browser with two additional tabs containing the URLs of front end and backend of your newly created app (If you are in Mac). Otherwise, Open the browser and go to http://localhost/kohana/ OR http://127.0.0.1/kohana/ if you are in other than Mac.

Demo

Download

You can fork/download it from github

Precautions

Make sure wget works in your system. Also make sure your php has cURL, mcrypt, GD enabled and Apache has mod_rewrite enabled. Those are needed to kohana.

Most Popular Free Hosting & Deployment Environments

Standard

webhosting
My observation on some hosting/deployment environments & virtual cloud servers which can be used as cost free for development and testing period without any hassle.

1. Openshift
Deployment environment. Supports git version controlling. Have their own command line tool. 1GB storage for both DB & files with 512 MB RAM allocated per small gear. SSL support on your app URL. Custom domain support. No payment method needed.

2. Appfog
Deployment environment. Supports version controlling. Have their own command line tool. 100MB DB & 2GB RAM per account. You can host/deploy unlimited apps within this resource. Free for ever. SSL support on your app URL. Custom domain support. No payment method needed. A how to tutorial here.

3. Heroku
Deployment environment. Supports git version controlling. Have their own command line tool. 10K DB Rows & 512 MB RAM allocated per web dyno. You can host/deploy unlimited apps within this resource. Free for ever. SSL support on your app URL. Custom domain support. No payment method needed.

4. Amazon EC2 micro instance
A full featured virtual private server. Choose the operating system to be installed on it and you are done! Access & manage that VPS through your local machine’s terminal. Install packages, configure different types of environment, create users, deploy your app there. Actually use that remote machine as like you do in your own locac Unix/Windows server system. 8GB storage for whole system purpose with 613 MB RAM including 2 CPU per instance. One year free. Need payment method to be verified while sign up.

5. Amazon Beanstalk
Deployment environment. No need to configure any server from scratch. Just select your app type to be deployed & it will build up an environment to suit your app on background. Have their own command line tool for better managing your app from local machine. Supports version controlling. Uses the micro instance on behind. One year free. Need payment method to be verified while sign up. A how to tutorial here.

More on my mind is pagodabox, joyent etc.

Authentication Module with E-mail & Image Verification!

Standard

I’ve built an authentication system which can be used as secured module in a registration form or in a suggestion box where there are probability of insertion of data by a robot script. By using the image verification fact no auto generated script can fill up a form. Other wise there is an e-mail verification fact by which the man who fill up the form giving his e-mail address should check up his inbox for the mail sent by the form.
The e-mail is sent with a link on which by clicking it executes a script for neccessary update in the database.

In this module when a user fill up the form then in database every data is inserted and in a filled named active ‘0’ is inserted. When the user clicks on the link sent to him by e-mail. It then executes another script page which then updates the value of active field into ‘1’.
Then you can verify a user by examining the value of his active field in database that ensures that he clicked on th link.
This can be used as module in any Webapp.

You can download the source code Download