How To Install Laravel On Linux With PHP 5.4

I looked up a few tutorials online on how to install Laravel and I got to the point where composer was giving me an error saying that i needed to upgrade to PHP 5.5. Since I had 5.4 running on the server and also had quite a lot of stuff already running on this server I was left in a difficult position where I needed to install Laravel and it seemed like I was required to install PHP 5.6 or 5.5. These are not supported by the default repos with CentOS. Going down the road of using custom repos is just asking for trouble, so I decided to find a way to do this without having to upgrade. So here is how I installed Laravel using PHP 5.4.

I am going to assume that you already have apache and php installed and running on your server.

Install Composer

I looked around and everyone was saying to run a bunch of stuff to download and compile composer. Seems like a waste of time when it was available using yum. I’m not sure if this is required, but you should install the epel repo to make sure you can install everything you need.

yum install epel-release

yum install composer

Thats it, composer is installed. Sure beats having to do a bunch of weird stuff to get it installed.

Install Laravel

Based on the official documentation for installing Laravel 5 http://laravel.com/docs/5.0 there are 2 different ways to install. I first tried to do it via the laraval new method and this worked, but it messed up. It seemed like the version of php I was running did not live up to the requirements. I don’t know why, so i tried the second option and this worked! To do this i ran the following commands.

cd /var/www/html

composer create-project laravel/laravel laravelproject "~5.0.0" --prefer-dist

This will begin the install process which can take some time as it does a whole load of stuff. Half way through i got an error message saying I needed a GitHub access token in order to continue further. Thankfully i already have a github account, but if you do not then you will need to create one.

Could not fetch https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5 b578d3865a9128b9c209b011fda6539ec06e7a5, please create a GitHub OAuth token to g o over the API rate limit
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+ on+ns358641.ip-91-121-153.eu+2015-11-17+2105
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
Token (hidden):

To get a GitHub access token, follow this guide. https://help.github.com/articles/creating-an-access-token-for-command-line-use/

Enter the Github access token and it will continue with the install.

Once installed this should be it. If you go to the laravel/public directory in your browser you should see the default Laravel page. If you get an error 500 then it is likely due to apache not having write permissions. This can be fixed with the chown command.

chown -R apache /var/www/html/laravel

 

Related Articles

Related Questions

Why Did My PC Freeze and Fail to Boot?

I was using my PC just fine yesterday, but while I was in the shower last night, it completely froze. When I returned, I...

Help! My PC Won’t Boot Properly During Finals

Hey everyone, I'm really in a bind here and could use some help. I bought a new CPU from Shopee about a year or...

How can I change my LG TV settings without the remote?

I'm having trouble with my LG TV where it doesn't show the menu when I press the power button. If I hold the button,...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Tools

OpenAI Token Calculator

This tool is a simple OpenAI token calculator, web-based utility designed to help you quickly estimate the number of tokens in your text when...

List Sorting Tool

Welcome to our innovative list ordering and management tool. This next-level platform enables you to sort a list of items in ascending or descending...

Sudoku Solver

Welcome to our free online Sudoku solving tool, an interactive platform for puzzle enthusiasts seeking a break from a Sudoku conundrum. This advanced platform...

Apply Image Filters To Image

Digital imagery in the modern world is all about reinforcing emotions and stories behind each photo we take. To amplify this storytelling, we are...

Add Watermark To Image

As the world is increasingly consumed by digital media, protecting your original images is paramount. We are thrilled to introduce you to our innovative...

CSV To Xml Converter

Welcome to our CSV to XML converter tool, a convenient and user-friendly solution for all your data conversion needs. This versatile tool on our...

Latest Posts

Latest Questions