Array

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

Function Keys Reversing Between Fn Actions And Normal

My keyboard has the usual F1 to F12 keys along the top. I use these for shortcuts in various applications. These keys also have...

Whirlpool Oven F6E6: Appliance Manager 1 Board Communication

I have a brand new Whirlpool oven W11I OM1 4MS2 H or (859991549450). I bought it alongside the microwave combi oven. I have had...

Whats the difference between the Tapo P100 and the P105?

There are a few different Tapo smart plugs. The P100 and P110 differ based on the smart power monitoring feature but where does the...

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

AI Content Detector

We've got this awesome free tool that'll help you figure out if that content you're looking at was written by a human or some...

Image Saturation

Are you looking for an easy-to-use, free app to modify your image saturation levels and make your pictures truly pop? Look no further! Our...

Pixelate Image Tool

Introducing the ultimate free online image pixelator tool that allows you to easily transform your images into stunning pixel art in just a few...

Image RGB Level Adjustment Tool

Introducing the ultimate image color adjustment tool for all your photo editing needs. Our free online tool lets you take full control of your...

Image Color Inverter

Looking for a quick and efficient way to convert your images into negatives? Our Free Image to Negative Converter is the answer! Our online...

Negative Image to Color Image Converter

Welcome to our Negative Image to Color Image Converter, a free and easy-to-use tool that helps you convert your old negative images into vibrant,...

Latest Posts

Latest Questions