Nette Framework + c9.io = :heart:

Nette Framework is one of the best PHP Web frameworks for me. It is Open-Source and combines lot of super pieces like Latte for templates, Tracy for debugging and lot of awesome classes from core framework.

Getting started

Create a Cloud9 workspace of the type „PHP“

Create a Nette Project

Open your Terminal and execute the following to create a new Nette-Project

rm README.md php.ini hello-world.php
composer create-project nette/web-project
mv web-project/* ./
rm -rf web-project

Running the project

As web-project is serving its content from the „www“ 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/www

To save the file press F2, then Y and Enter.

Then we restart apache

sudo apache2ctl restart

And open „Preview“

Profit :-)

(rewrited from originals: https://docs.c9.io/docs/symfony2 and https://docs.c9.io/docs/laravel)


PS: Because c9.io use some proxy system, running debug mode on my IP address doesn't work with classic way, but this simple hack works:

in bootstrap.php

// Change this line
$configurator->setDebugMode('23.75.345.200');

// To following
$configurator->setDebugMode($_SERVER['HTTP_X_FORWARDED_FOR'] === '23.75.345.200');

nette sandbox cloud9