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'