Installing Laravel 5.5 On CodeAnywhere

CodeAnywhere is a great cloud IDE to create web apps but it lacks that latest install of Laravel. So I used the latest PHP stack as my base and then installed the latest version of Laravel 5.5 with additional packages.

Basic Steps to Install Laravel 5.5

  1. Create a new Container (Hook up a Bitbucket or GitHub repo first if there is an existing repo) use the PHP7 CentOS Stack
  2. Once container is loaded update composer: composer self-update
  3. Then install Laravel on the root of workspace:
    composer create-project laravel/laravel basicwebsite
  4. Install Nano editor: sudo yum install nano
  5. Edit Document Root on Apache http config file:
    sudo nano /etc/httpd/conf/httpd.conf
  6. Scroll down a ways to the section where it says Document Root: change that to
    home/cabox/workspace/basicwebsite/public
  7. You can also change working directory to:
    home/cabox/workspace/basicwebsite/
  8. Save changes from the last two steps and exit.
  9. Restart apache: sudo apachectl restart
  10. Change permission of storage directories:chmod -R ugo+rw storage/ and chmod -R ugo+rw bootstrap/cache/
  11. You can save this container as a template stack for other future containers.
  12. Now your Laravel 5.5 app should work. Happy Coding!

 

Optional: Installing Node/NPM

Furthermore, it may be desirable to install node to compile your laravel assets. Here’s the steps I took to do just that.

  1. Follow this NVM Guide to install Node
  2. use this curl command:
     curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
  3. install node: nvm install node
  4. cd in the laravel project directory and run npm install . This will install all the required javascript dependencies.
  5. Then you can run npm run watch which will start a live server that will be constantly monitoring for any changes to the project sass and js files and update your site accordingly