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 proper 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
Add your laravel.conf apache2 configuration to /etc/apache2/sites-available.
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 webmaster@localhost 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
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 .env.sample to .env in 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 .env file in your application directory.