You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-3Lines changed: 68 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,17 @@ For a quick version of the guide (many of you might already read about it), read
6
6
7
7
## Requirements
8
8
9
-
Before trying to deploy a Laravel/Lumen application on a shared hosting, you need to make sure that the hosting services provide a fit [requirement to Laravel](https://laravel.com/docs/5.2#server-requirements). Basically, they are the following items:
9
+
Before trying to deploy a Laravel/Lumen application on a shared hosting, you need to make sure that the hosting services provide a fit [requirement to Laravel](https://laravel.com/docs/5.2#server-requirements). Basically, following items are required for Laravel 5.2:
10
10
11
11
* PHP >= 5.5.9
12
12
* OpenSSL PHP Extension
13
13
* PDO PHP Extension
14
14
* Mbstring PHP Extension
15
15
* Tokenizer PHP Extension
16
16
17
-
Next, you need to have the SSH access permission for your hosting account; otherwise, none of these will work.
17
+
Well, it also depends on the Laravel version you want to try to install, checkout the appropriate version of [Laravel server requirements documentation](https://laravel.com/docs/master).
18
+
19
+
**Next, you need to have the SSH access permission for your hosting account; otherwise, none of these will work.**
18
20
19
21
Besides PHP and those required extensions, you might need some utilities to make deployment much easier.
20
22
@@ -25,7 +27,70 @@ I guess that's enough for good. Please refer to below sections to learn more abo
25
27
26
28
## Instruction
27
29
28
-
TBU.
30
+
Let's get started by understanding how we should organize the Laravel application structure. At first, you will have this or similar directories and files in your account,
31
+
32
+
```
33
+
.bash_history
34
+
.bash_logout
35
+
.bash_profile
36
+
.bashrc
37
+
.cache
38
+
.cpanel
39
+
.htpasswds
40
+
logs
41
+
mail
42
+
public_ftp
43
+
public_html
44
+
.ssh
45
+
tmp
46
+
etc
47
+
www -> public_html
48
+
...
49
+
```
50
+
51
+
For the main account which tied with the main domain, the front-end code should stay in `public_html` or `www`. Since, we don't want to expose *Laravel things* (such as, .env, ...) to the outside world, we will hide them.
52
+
53
+
Create a new directory to store all the code, name it `projects` or whatever you want to.
54
+
55
+
```
56
+
$ mkdir projects
57
+
$ cd projects
58
+
```
59
+
60
+
Alright, from here, just issue a git command to grab the code,
61
+
62
+
```
63
+
$ git clone http://[GIT_SERVER]/awesome-app.git
64
+
$ cd awesome-app
65
+
```
66
+
67
+
Next step is to make the `awesome-app/public` directory to map with `www` directory, symbol link is a great help for this, but we need to backup `public` directory first.
68
+
69
+
```
70
+
$ mv public public_bak
71
+
$ ln -s ~/www public
72
+
$ cp -a public_bak/*.* public/
73
+
$ cp public_bak/.htaccess public/
74
+
```
75
+
76
+
The hard part is done, the rest is to do some basic Laravel setup. Allow write permission to `storage` directory is important,
77
+
78
+
```
79
+
$ chmod -R o+w storage
80
+
```
81
+
82
+
**Edit your `.env` for proper configuration. Don't miss this!**
83
+
84
+
Lastly, update the required packages for Laravel project using **composer** and add some necessary caches,
85
+
86
+
```
87
+
$ php composer install
88
+
$ php composer dumpautoload -o
89
+
$ php artisan config:cache
90
+
$ php artisan route:cache
91
+
```
92
+
93
+
**Congratulation! You've successfully set up a Laravel application on a shared hosting service.**
0 commit comments