Skip to content

Instantly share code, notes, and snippets.

@israteneda
Last active August 23, 2018 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save israteneda/b323abca437b1bf8688352f3786a2252 to your computer and use it in GitHub Desktop.
Save israteneda/b323abca437b1bf8688352f3786a2252 to your computer and use it in GitHub Desktop.
Install Laravel 5.6 on C9
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install php7.2 php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml
sudo apt-get install libapache2-mod-php7.2 -y
sudo a2dismod php5
sudo a2enmod php7.2
sudo service apache2 restart
sudo composer self-update
sudo composer global require "laravel/installer"
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
source ~/.bashrc
# phpMyAdmin install
phpmyadmin-ctl install #Login with the url/phpmyadmin, your c9 user and empty password
# Create project
laravel new project
# As Lavarel is serving its content from the public directory we need to modify the apache config using nano (a text editor):
# sudo nano /etc/apache2/sites-enabled/001-cloud9.conf
# Then do the following:
# Change this line
# DocumentRoot /home/ubuntu/workspace
# To following
# DocumentRoot /home/ubuntu/workspace/yourproject/public
# Edit the Laravel environment configuration file “.env” (in the root directory) and add the database settings
# DB_HOST=localhost
# DB_DATABASE=c9
# DB_USERNAME=USERNAME
# DB_PASSWORD=
# Update node
nvm i v8
# Set as default
nvm alias default 8.11.4
# change directory
cd project
# Install node dependencies
npm install
# You should put these lines for make a migration
# path: app/Providers/AppServiceProvider.php
# use Illuminate\Support\Facades\Schema;
# inside of boot() function
# Schema::defaultStringLength(191);
# make migration
# php artisan migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment