Going live with Laravel

I have been developing and testing my first Laravel web application for a while now and posting my web hosting service is long over due.

Web Hosting

Support for PHP version 5.3

Both of my existing web hosting services use PHP 5.2, with no plans to upgrade to 5.3 in the near future.

So after a quick look around I choose one.com. They are based in Denmark, they support the latest PHP and MySQL and offer one year's hosting for the setup cost of £9 plus VAT.

Moving the Shed22.com domain

I recently needed to move my domain and email services, so this was a very good time to move the web hosting, domain and email to one.com.

Can't wait to get my first Laravel web application up and running.

Getting Laravel running

A slight problem with One.com hosting is that they do not have a /public_html folder, so everything in the root structure is public. So I needed to change the directory structure (see below) and change the .htaccess file to read:

 RewriteRule ^(.*)$ index.php?/$1 [L]

(add question mark [?] after index.php) instead of

 RewriteRule ^(.*)$ index.php/$1 [L]

Laravel Version

Laravel 3.2 Requirments

When I went to upgrade to Laravel 3.2 (about a month ago) I found that it now requires the PHP mcrypt library. A quick look at the install procedure for mcrypt and I decided to carry on using Laravel version 3.1.8.

But before I go live, I would like to move to the latest version of Laravel, and also make sure that my development system is using the same version of PHP as the live version.

I am using Mac OS X 10.6 (Snow Leopard) and I found a very simple upgrade procedure at php-osx.liip.ch/. I copied the one-liner command for PHP 5.3 in the terminal window (and waited about 5 minutes while it worked its magic) - then phpinfo() confirmed that I was running PHP 5.3.13 with mcrypt installed. Two birds, one stone.

A quick test with the latest version of Laravel and everything is looking OK.

Laravel Directory Structure

When I first discovered Laravel the directory structure was beautifully simple - just three folders: Application, Laravel and Public. With Laravel version 3.2.1 there are now 5 folders and the paths.php file, so I want to simplify the structure, where the Public files sit in the root directory and everything else is tucked away in one folder.

My first step is to create a new folder (which I call core) and copy all files apart from the public folder into the “core” folder. I move all the files from the public folder into the root. The only two changes required is update the path to paths.php in index.php (root folder) and update the url in the /config/application.php file.

That was too easy. A few tests are required to see if it all works before I upload the app ...

<<  back