PHP Quickstart Guide
In order to get a Laravel app running, here are the following steps you need to make sure you do:
Setup Basic Configuration
- Add your repository.
- Select PHP stack and choose the suggested version.
- Follow the suggested recommendations for build and start commands. See below for slight modifications.
Set Permissions for Your Application Directory
- Add the following lines to the Build Commands section under Commands & Packages
$ chgrp -R www-data /var/www/html/ $ chmod -R 775 /var/www/html/storage
laravel.conf apache2 configuration to
You can do this by clicking on Files & SSH Keys and clicking the Add dropdown then File. This will bring up the Upload File modal.
Select your configuration file (
laravel.conf). It would look something like this:
<VirtualHost *:80> ServerName localhost ServerAdmin [email protected] DocumentRoot /var/www/html/public <Directory /var/www/html/> AllowOverride All </Directory> ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined </VirtualHost>
Add the following scripts to Scripts:
$ a2ensite laravel.conf $ a2enmod rewrite
Set up your Laravel environment
Add the following lines to the Build Commands section under Commands & Packages
- Copy your
.envin your project directory:
$ cp .env.example .env
- Generate your application key:
$ php artisan key:generate
After your container builds, you should be able to click the button to the right of the URL to see your app. Then, you can start creating MySQL and Redis containers in Runnable and link them in the Environment Variables section.
You may need to remove the overrides in the
.envfile in your application directory.