Saturday, June 28, 2014

Hello LAMP with Codio


Codio has just announced that their web-based IDE is out of beta. They claimed that I could have a full LAMP stack set up in seconds. Zend made similar claims about their PHPCloud (which is now killed off by Zend) and while I did get it working and am a fan, it took some head scratching before I got it going. So, I set out to to get a “Hello LAMP” application working in Codio. It turned out to be fairly straightforward.

Here is what I did along with a link to the public project. You can check out all the Codio features and project settings etc. on the Codio site.
  1. Sign up for a free Codio account
  2. Click Create Project from the Dashboard, enter a project name and choose the PHP Project template. I kept this one Public. (Public means anybody can view it but they can’t edit it. Read more about that on their website). Click Create Project:

    image
  3. A project will almost instantly be created for you. Click on index.php in the Filetree and you will see that they have a “Hello PHP” already there for you. Right-click on index.php and select “Set as project index”. If you try to run this, you will be out of luck because you still need the A in LAMP. On the top menu bar click Tools –> Terminal and plug this in:

    2014-06-28_16-07-40
  4. You still wont be able to play your app because Apache isn’t running. This is spelled out to you in the terminal after the parts are installed. Do what it says AND switch your run option to “Box URL” AND… you still won’t be able to play your app!:

    image
  5. Don’t despair, there’s one more part to install ‘php5-apache2’ and then restart Apache:

    image
  6. Run the app via Box URL and VIOLA!

    image

  7. The name of this blog post is “Hello LAMP” so let’s start the M here:

    image

    image
  8. Create a database and then create your table and put at least a row in it:

    image
  9. Add your PHP code to index.php for reading and echoing your text from the database table:

    image

  10. Run your code and…

    image

The public project is out on Codio and you can check it out here: https://codio.com/joeldpalmer/PHP-Test
I’m pretty impressed with Codio as of now. If they add an integrated PHP debugger, that will make it a complete PHP IDE.


Bye PHP Cloud. I had high hopes. :-(

No comments:

Post a Comment