Tips for running a LAMP stack on

Pre-installed LAMP tools:

  • apache
  • mysql (and necessary PHP plugins)
  • php version 5.4

Apache Server

apache can automatically be run from the codebox UI by simply clicking the run button.

Builtin PHP server

If apache is not installed, when clicking run, codebox will fallback to the builtin php server. Which is essentially the following command:

php -S$PORT


MySQL can be started or stopped with the following commands :


sudo mysqld


sudo killall mysqld


By default on the MySQL credentials are :

  • username: root
  • password: root does not expose the credentials in environment variables yet.


Accessing the admin UI

phpmyadmin is installed by default on, when using the apache runner you can access the phpmyadmin UI by visiting the /phpmyadmin/ url.


The phpmyadmin credentials are the same as specified above for mysql.

PHP Code Example

A simple PHP sample that connects to the MySQL database prints the info.

// Connect to MySQL database
$link = mysql_connect('localhost', 'root', 'root');

// Error connecting
if (!$link) {
   die('Error connecting to MySQL server : ' . mysql_error());

// Print out information on the MySQL host
printf("MySQL Host info : %s\n", mysql_get_host_info());