Example: serving a Laravel project with a symlink app

Modern PHP web frameworks such as Laravel typically serve their content from a subdirectory of the project directory. PHP apps on Opalstack are served from the app directory, so a symlink app is needed instead of a regular PHP application.

1

Create a shell user if you have not done so already. You can use an existing shell user if you wish.

The rest of this example will use myuser as the shell user name.

2

Upload your Laravel project into your shell user's home directory.

The rest of this example will use mysite as the Laravel project name.

3

Create a new symlink application with the following values:

  • Type: PHP-FPM+Apache (Symbolic Link)
  • FPM Max Requests and FPM Max Child Threads: accept the defaults
  • Symbolic Link Path: /home/myuser/mysite/public (change myuser and mysite to your shell user and project names.
  • Name: whatever you like. For this example we'll use mysite_public_symlink
4

Create a site to serve the symlink app from step 3 on the URI path /.