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.
- 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();?>
- 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.)
- In Termux, do pkg install git – presuming that you want to pull in something!
- pkg install php
- Start a server: php -S localhost:8080 -t storage/downloads/
- 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