On February 12th, Nitrous.IO, the cloud development environment that lets you set up virtual boxes in a flash and use them from whichever platform through their Web IDE, finally added PHP support – something users have been clamoring for.
You can read more about it in the announcement, but I figure it’s best if we demo by example and get a Laravel app up and running.
Note: This tutorial assumes basic Unix terminal proficiency.
Getting started
Create an account on Nitrous.io if you don’t have one yet, or follow my ref link here to do so (full disclosure, this gives me nitrous – the currency used to bring more powerful VMs online). After spiffying up your profile, I encourage you to go into Public Keys and add a public SSH key of your own if you generally use them for SSH connections and similar. A detailed guide is available on GitHub.
Creating a box
Let’s go into Boxes and click “New Box”. Select PHP, a region closest to you, and allocate as many resources as you wish – you can spend your entire Nitrous balance on this if you so choose – when you terminate a box, your nitrous is refunded.
After clicking Create Box, your box will be provisioned – not unlike with Vagrant. You just won’t see as much output, and it’ll be much faster.
Once done, you’ll be greeted with a friendly and vaguely familiar interface, along with an introductory file that guides you through setting up the rest.
You can also run a PHP box by using any other template, and then using the Autoparts -> Install Parts menu to install PHP related tools like Apache, PHP, MySQL, etc. In the PHP box template, those parts are included. If you now use the included console to output the PHP version, you should see 5.5.8 displayed:
“Parts” is something like Nitrous’ custom tailored package manager, and you use it to start services and install parts. Parts can also automatically install WordPress for you, but who would want that anyway?
PhpInfo
Open the workspace folder, and create a file called index.php in the www subfolder with the contents:
<?php
phpinfo();
Then, go to Preview -> Port 3000 (the default). You should see the following PhpInfo screen in your browser:
Note that the other ports won’t work unless you configure them that way. The first one (3000 SSL) is a premium feature, and you’ll have to pay for it, while all others can be defined if you use the console to edit httpd.conf:
vim /home/action/.parts/etc/apache2/httpd.conf
Note that you can access these files through the file browser as well, just remember to click “Show Hidden” at the bottom of the file browser. I find it simpler to go through the command line, though.
Installing PECL libs
Composer needs the Zip library to work, and installing it on our box is very simple, as per instructions
pear config-set php_ini /home/
Truncated by Planet PHP, read more at the original (another 14750 bytes)
more
{ 0 comments... » Getting Started with Laravel on Nitrous.io read them below or add one }
Post a Comment