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

Is Railway more expensive than it seems?

I'm trying to figure out if Railway really is as affordable as some people say. They charge based on provisioned resources like GB and...

Can I Declare a Lambda Later in C++?

Hey folks! I'm working on a function where I need to set up a compare function based on certain conditions in C++. I thought...

Help! Someone’s Trying to Hack My Facebook Account

Hey everyone, I really need some advice because I'm having a frustrating issue with my Facebook account. For the past few months, I've been...

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

Online Hash Generator – String to Hash Converter

Need to quickly generate a hash from a string? Whether you're verifying file integrity, securing data, or just experimenting with cryptographic tools, this simple...

Convert CSV To HTML Table

Need to quickly turn CSV data into an HTML table? Whether you're copying data from Excel, Google Sheets, or another spreadsheet, this tool makes...

Student Group Randomizer

Creating fair and balanced groups in the classroom can be time-consuming — especially when you're trying to avoid repetition, manage different skill levels, or...

Random Group Generator

Need to split a list of people, items, or ideas into random groups? Our free Random Group Generator makes it quick and easy. Whether...

Flip Text Upside Down – Free Online Tool

Ever wanted to flip your text upside down just for fun or to grab someone’s attention in a creative way? This free online Upside...

Raffle Ticket Generator

If you're running a fundraiser, charity draw, or local event and need raffle tickets fast, this free online tool lets you generate and print...

Latest Posts

Latest Questions