Before we begin, I suppose your first question is "What is Laravel?" Laravel is a free, open source PHP web application framework, designed for the development of MVC web applications. Laravel is built on top of several Symfony components, giving your application a great foundation of well-tested and reliable code.
The Easy Way:
As a GlowHost customer, you can always install Laravel in just one click. It can be found in your GlowHost control panel when you click on the Softaculous Icon.
Paper lantern theme:
x3 Theme:
We'll show you how to install it manually for those of you who are interested in what's happening behind the scenes or want to learn how to install this without an auto-installer.
1. You will need SSH access. Please contact us and we will enable normal shell for your account.
2. Install Composer (it is a dependency manager for PHP, and required for Laravel). Please note, you can always ask our support to do this. If you decide to perform installation on your own, please use these commands:
a)
Code Block | ||
---|---|---|
| ||
user@server [~]# cd bin/ user@server [~/bin]# wget https://getcomposer.org/installer user@server [~/bin]# php installer --check All settings correct for using Composer user@server [~/bin]# php installer All settings correct for using Composer Downloading... Composer successfully installed to: /home/user/bin/composer.phar Use it: php composer.phar user@server [~/bin]# rm -f installer |
...
b) Install your first project:
Code Block | ||
---|---|---|
| ||
user@server [~/public_html]# mkdir project/ user@server [~/public_html]# cd project/ |
create composer.json file with the following code:
Code Block | ||
---|---|---|
| ||
{ "require": { "monolog/monolog": "1.0.*" } } |
and run:
Code Block |
---|
user@server [~/public_html/project]# composer install Loading composer repositories with package information Installing dependencies (including require-dev) - Installing monolog/monolog (1.0.2) Downloading: 100% Writing lock file Generating autoload files |
Great, everything is working! Now you can remove your first project
3. Install Laravel:
Code Block | ||
---|---|---|
| ||
user@server [~]# mkdir project user@server [~]# cd project/ user@server [~/project]# user@server [~/project]# composer create-project laravel/laravel --prefer-dist |
...
Code Block | ||
---|---|---|
| ||
Script php artisan optimize handling the post-install-cmd event returned with an error [RuntimeException] Error Output: [Symfony\Component\Process\Exception\RuntimeException] The Process class relies on proc_open, which is not available on your PHP installation. optimize [--force] [--psr] |
Here is an example:
Code Block | ||
---|---|---|
| ||
user@server [~/project/laravel]# php artisan clear-compiled user@server [~/project/laravel]# php artisan optimize Generating optimized class loader Compiling common classes |
...
An Important Tip #3 (special for cPanel servers):
Now we need to remove the public_html folder and make a symbolic link to public folder in our project (please be sure that the public_html folder is empty or you have a fresh backup copy of any data you may have there):
Code Block | ||
---|---|---|
| ||
user@server[~]# cd ~ user@server[~]# rm -rf public_html/ user@server[~]# ln -s project/laravel/public/ public_html |
...