Serve a Directory with PHP
Many developers have a giggle at PHP, even looking down at the language, but let's be honest: most of our blogs are powered by it (WordPress) and it's a great language to dabble around with. I cut my teeth on PHP, though I prefer to avoid PHP these days.
But when I need to experiment with a simple PHP coding task for the sake of a blog feature, I look for the simplest possible serving solution to accomplish that feat. Luckily PHP provides me a quick solution for testing:
php -S localhost:8888
The command above allows for serving of a directory via PHP, thus allowing for a simple PHP "site" to be served enough to confirm that my code testing works properly.
Serving a directory with PHP, python, or Node.js ... the same problem solved for different languages!
In 2001 I had just graduated from a small town high school and headed off to a small town college. I found myself in the quaint computer lab where the substandard computers featured two browsers: Internet Explorer and Mozilla. It was this lab where I fell...
It's no secret that Facebook has become a major traffic driver for all types of websites. Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate websites directly. And of course there are Facebook "Like" and "Recommend" widgets on every website. One...
In the five years I've been at Mozilla I've seen some awesome projects. Some of them very popular, some of them very niche, but none of them has inspired me the way the MozVR team's work with WebVR and A-Frame project have.
A-Frame is a community project...
Scrolling animations are fun. They are fun to create and fun to use. If you are tired of bootstrapping you might find playing with scrolling animations as a nice juicy refreshment in your dry front-end development career. Let's have a look how to create animating...
You can add easily a public directory to it by adding
-t
parameter.Love tips like this, thanks for putting them together!
If you’re using Linux. sudo right is required
To change a current directory function
chdir()
is used. It returns true on success and false on failure. Please note functionchdir()
works in PHP 4, PHP 5, PHP 7. Following is a description of this function.https://www.mindstick.com/Articles/12164/directory-handling-in-php
http://pixelcode.co.uk/tutorials/php/directory-handling-in-php/