Articles tagged with PHP

Running a simple server while developing locally

When you’re building a website one of the most important steps is the building of the templates. Building static templates is almost always quicker than building integrated templates such as WordPress, Django or Rails.

One of the biggest issues with using static templates straight off the file system is that file:// urls can have issues and relative links may have to be different than what they need to be when the site goes live. A local server is what’s needed, but things like MAMP, or LAMP servers can be a pain to setup,esecially if your working on multiple projects. Enter the simple server.

PHP has a basic server. Simple go to your project folder in the terminal and run the following:

php -S

This will setup a basic php server on the address and port provided.

With all these simple servers you have to remember that there is no database so you can only do simple functions and serve files, but not do anything more complicated. That's ...

Read post... Posted in 'Web development'

How and why to use example and local settings files

A local settings file is one that is never controlled by version control and only contains settings relevant to the server – local, development or live. Often the local settings file is created by an example settings file that has all the relevant settings ready to fill in. The example settings are always committed to version control so that each developer who works on a project can see what they need to fill in when they clone the project.

One other major advantage of not adding the local settings for a project is that it keeps server settings safer because only people with access to the server can see them, unlike a project repo where even if it’s private, any developer with access can see it, and if it’s an open source project then everyone can!

How do I make an example file?

  1. First take your config or settings file and save it with -example on the end of the file name.
  2. Go through the file and remove any settings with secret info like ...
Read post... Posted in 'Web development'

Jelly and

Over the last few months I have been wanting to polish up some existing skills and learn some new ones. Over this time I haven't had much time to work on projects that had the scope to play around with these skills so I decided to find a simple project that I could use as a test bed. Since the vet had recently estimated my cat's age I decided on a cat age calculator.

Does the internet need more cat based websites? Probably not, but the internet loves cats and I needed a project. The project needed a suitable name and so was born.

I prototyped the basic functionalities and interactions in javascript and jQuery. It could have continued as a js only app but I made the decision to move the calculations to the backend so that I could use some server side languages. I did consider creating a Rails app for the project, but not knowing enough about ruby or rails I decided it would be better to work ...

Read post... Posted in 'Projects'