Coding on Chromebook – Take 5

I love Chromebooks, and I’ve done all my coding on them for several years now – but mostly fully in the cloud (take 1!). I’ve also tried (2) Crouton, (3) Chromebrew, (4) Crostini. But then I discovered (5) the Play Store Android app Termux which encapsulates a linux environment.

Thanks to Will Schenk for this very clear article on how to set up Termux and a node.js server therein. But I develop PHP web apps. So the following notes are basically an extension of that piece.

Once you reach the point of linking the Termux environment to the downloads folder, I took the following steps.

  1. From the Chrome Web Store install the Caret editor if you haven’t already and plunk a test php file in Downloads (which now shows up as storage/downloads in Termux.) eg: <?php phpinfo();?>
  2. From the Play Store, install a browers like xbrowser as the Chromebook chrome browser cannot access a server running in the Termux environment (as far as I can tell.)
  3. In Termux, do pkg install git – presuming that you want to pull in something!
  4. pkg install php
  5. Start a server: php -S localhost:8080 -t storage/downloads/
  6. Run XBrowser to http://localhost:8080/index.php

Now, what Ireally want to do is develop apps with a single router.php script that parses the URL. You can achieve that by adding the name of a router script to the command, eg php -S localhost:8080 -t storage/downloads/ router.php