Getting right into things today I decided to make the jump-off point PHP. It’s my most familiar and comfortable language so why not begin there? I haven’t yet worked with the Symfony2 framework but I hear good things and I’m obviously new to Ember.js for the front-end so that should be a fun experience.
A quick google search recommends getting started with Composer. This is PHP’s answer to Node’s NPM – a dependency manager. In theory, with a couple commands I should be able to install Composer and then install the Symfony2 framework along with any other libraries I should want to use for my project.
Another goal of mine today was to make my dev environment strictly cloud based – text editing notwithstanding. So I began by launching and configuring an Amazon Linux AMI EC2 micro instance.
First thing to do was to install Apache, MySQL and PHP which is all pretty standard stuff. Next off I grabbed Composer. Commands get a little funky because I have to essentially “sudo” everything (I know just enough Linux to get myself in trouble). I landed on a site which had me install Composer into the /usr/local/bin folder, although other tutorials that I saw presumed that the “composer.phar” file resided in the webroot folder.
After Composer was installed then I ran composer to download Symfony2 and initialize a project. Eagerly I ran to fire up my instance’s freshly associated IP Address only to run into a handful of problems both in opening up the proper ports in the AWS security group and subsequently tinkering with Apache’s httpd.conf hosts so it played nice with Symfony.
There were two additional hiccups, both AWS related. The first was that the PHP installed did not have a default timezone. I had to modify the php.ini file, uncomment the line and tell it to set my timezone to “America/New_York”. Secondly, it was yelling at me for not having permissions in the “log” and “cache” directories inside the app folder.
At this point Symfony was yelling at me for trying to access it from an external IP address since it’s set up for localhost dev connecting only in this mode… so I commented out that safety feature in the app_dev.php file and presto.. the default Symfony Hello World App welcome page.
I wrapped up the hour or so I had to work with by installing git on my EC2 instance, committing the project directory/webroot and pushing that to a new repository I made up for this project.
In order to be as flexible as possible in this cloud dominated world of webapps, I want to familiarize myself with all of EC2′s quirks and force myself whenever possible to provision, configure, and troubleshoot getting my apps up on the fly. If I had all the time in the world, digging much deeper into Linux would probably yield some really great results. As it is, I’ll learn what I need to know when I need to know it.