RT Cunningham


Server-Side Scripting with PHP instead of Other Languages

server-side scripting I recently read some forum comments about using PHP for server-side scripting. The people directed their comments toward someone just beginning to learn PHP. They were telling that person that he or she should learn something else, like Python, instead of PHP.

Why not PHP? It’s been around for years, longer than I can remember. It’s a mature programming language. I think some people hate it, but I really can’t understand why.

Scripting with PHP

I wouldn’t recommend PHP as a client-side scripting language. Sure, you can use it that way (and I do) but using it for server-side scripting is where it works the best.

I’m well aware of other server-side scripting languages, like ASP, Python and Node.js. For simple, regular websites on non-Windows servers, I think PHP is the best language to use. The online manual is easy to follow.

PHP is dead simple to use. You can embed it or you can include it, although including means embedding at least one line. There are template engines available if you’d rather not mix HTML and PHP.

Minimal Scripting

Just because it’s available doesn’t mean you have to use it for everything. Many content management systems like WordPress use PHP, but it’s unnecessary for static websites. Well, mostly.

There are some aspects to every website that need one type of scripting or another. Even if it’s something as simple as “server-side includes” (SSI) handled by the web server itself, you need something to process forms with. That is, unless you don’t use any forms at all.

My website is static. The only thing I use PHP for is to process the contact form.


Node.js is server-side JavaScript, more or less. If I wanted to recommend something other than PHP, I would go with that. It isn’t even close to being as mature as PHP but there are websites using nothing else. The Ghost blogging platform uses Node.js.

The advantage is using the same language for both sides, client and server. I haven’t seen a JavaScript manual that can match the manual PHP uses, so take that for what it’s worth.

Share: Facebook | Twitter

By RT Cunningham
April 3, 2017
Web Development