Sophomore Dev
The Dev You Say

Exploring the Benefits of PHP Built-In Web Server

May 2nd, 2023

And Now for a Public Service Announcement

Well, well, well, look who’s back! It’s me, your favorite forgetful former Sophomore Dev Andrew who disappeared off the face of the internet for a couple of years (not really). Remember me? No? Yeah, I don’t blame you. Even I forgot about my blog until recently when I stumbled upon it by accident while trying to find a recipe for vegan lasagna (not really). Oopsie! So here we are, back at it again with the mediocre content and occasional spelling errors. But hey, a lot has changed in the past few years – like seriously, have you seen what’s going on in the world right now? So buckle up and let’s see if I can still string together some coherent sentences and make you laugh (or mostly – cringe) along the way.

Why am I writing about the built-in PHP web server today? Well, because I actually wanted to write about something else entirely, something that could be summed up in two sentences, and that seemed like a bad start to rebooting the site.

PHP is one of the most popular web development languages used in the world today. It provides developers with a robust set of tools to create feature-rich and dynamic web applications. One such tool that PHP offers is its built-in web server – a handy way to test applications and share local files on your network quickly.

We’ll dive deeper into what the PHP built-in web server is, how it works, and why it’s useful for developers.

What is the PHP Built-In Web Server?

The PHP built-in web server is precisely what it sounds like – a lightweight server that comes bundled with PHP installations. It allows developers to serve their web applications locally without requiring external software like Apache or Nginx.

The built-in server supports execution of PHP scripts, catch-all routing, and static files with common MIME types. It provides an integrated solution for testing and development purposes, allowing developers to work efficiently in a familiar environment.

Why Use The Built-In Web Server?

There are several benefits to using the PHP built-in web server:

  1. Simplicity: The built-in web server is easy to set up and requires no additional configuration or installation processes beyond installing PHP itself.
  2. Lightweight: Since it’s designed only for development purposes and not production use, it’s lightweight in nature, making it faster than other servers like Apache or Nginx.
  3. Security: The built-in web server has limited features compared to dedicated servers; this makes it less prone to vulnerabilities and hacking attempts.
  4. Cross-Platform Compatibility: The built-in server runs on all major operating systems; Windows, Mac OS X, Linux/Unix-based systems as well as different versions of PHP (5.x – 8.x).
  5. Integrated Debugging: Developers can take advantage of integrated debugging tools since both the application code and the webserver run on the same machine.

How to Use the PHP Built-In Web Server

Using the built-in web server is straightforward. First, ensure PHP is installed on your computer. Then open a terminal or command prompt and navigate to your project’s root directory. Finally, start the web server with the following command:

php -S localhost:8000

This command will start the built-in webserver at port 8000 of your local machine. Visit http://localhost:8000 in your browser to see your application running.

You can also specify a different port like this:

php -S localhost:8080

The PHP Built-In Web Server is a great tool for developers who want an easy-to-use, lightweight solution for testing and developing their applications locally. It provides all the necessary features required for development purposes without compromising on performance or security. If you’re looking for a convenient way to test your applications without relying on external servers, then give the built-in web server a try today!

Rustic or Hipster Wedding?

August 29th, 2016

How to tell if you have been invited to a hipster wedding is one of those social survival skills that will keep you from looking like an idiot when you show up. This handy info graphic will lead you through the steps to tell if your wedding, or the wedding of a friend is headed to hipsterville. Of course not all rustic weddings are hipster inspired.

hipster wedding infographic

The original infographic is originally from refinery29.com but I couldn’t find the page.

Do You Put the Hip in Ster?

August 28th, 2016

You know you’ve made it mainstream when Wikihow writes about you. But is their diluted tutorial really all it takes to become a Seattle hipster?

Now you can find out exactly what type of Seattle Hipster you are with this handy quiz.

The Lost City of Melbourne

August 28th, 2016

It appears like there is a new lost city. Melbourne.

Though they’re trying to minimise it, the recent relocation of Melbourne Australia to the ocean east of Japan in Microsoft’s flagship mapping application is blamed on someone having flipped a sign in the latitude given for the city’s Wikipedia page.

This statement may or may not be the actual cause of the issue. One thing is certain though, it does produce a question about accuracy on other areas of the map.

As unfortunate as this is it won’t deter me from using the service in the future.

Tiny Fedoras for Hipster Man Buns

August 28th, 2016

Admit it, you thought you had seen everything didn’t you.

The emerging Capitol Hill fashion combo of the man bun hairstyle topped with a micro-fedora successfully unites the best of contemporary styles in hair and hats for young men. This autumn, expect to see the new look showing up in trendier spots all over the Hill.

Maybe my man bun needs some shade?

Pokemon Go! Killer

August 27th, 2016

Alright, you got me. I played Pokemon Go like there was no tomorrow for about a day. I have something like a hundred and twenty pokemon since my last count. But those days are over. I actually broke out the GBA and Saphire just for the prosperity of it.

Now there is a new game on the market, and it comes out of Belgium.

A Belgian primary school headmaster has developed an online game for people to search for books instead of cartoon monsters, attracting tens of thousands of players in weeks. Players post pictures and hints about where they have hidden a book and others go to hunt them down. Once someone has finished reading a book, they “release” it back into the wild.

“While I was arranging my library, I realized I didn’t have enough space for all my books. Having played Pokemon Go with my kids, I had the idea of releasing the books into nature,” Gregoire told Reuters.

Though it was only set up a few weeks ago, more than 40,000 people are already signed up to Gregoire’s Facebook group.

If you need help creating the app you know where to find me.

SpaceX Dragon Returns Home From ISS

August 27th, 2016

Great, success!

A SpaceX Dragon capsule that helped prepare the International Space Station for future commercial astronaut flights has returned to Earth after a stay of more than month-long mission. A robotic arm released the unmanned capsule packed with 3,000 pounds of cargo at 6:11 a.m. EDT, then fired thrusters several times to move a safe distance away from the station orbiting about 250 miles up. The departure began a less than six-hour journey that culminated in a Pacific Ocean splashdown at 11:47 a.m. EDT, about 300 miles southwest of Baja, California. The Dragon launched from Cape Canaveral early July 18 on a Falcon 9 rocket and berthed at the station two days later. Among the cargo brought back from space Friday were a dozen mice from a Japanese science experiment — the first brought home alive in a Dragon. Samples from mice euthanized as part of an experiment by pharmaceutical company Eli Lilly also were on board. Results were returned from an experiment that studied the behavior of heart cells in microgravity, and from research into the composition of microbes in the human digestive system, NASA said. Findings from both could help keep astronauts healthy during deep space exploration missions.

But SpaceX hopes to kick off Labor Day Weekend early next Saturday (September 3rd) with a Falcon 9 rocket launched from Cape Canaveral Air Force Station.

This is a big deal if you have been following SpaceX news in recent months.

Floating Solar Device Boils Water Without Mirrors

August 27th, 2016

The search for better/cheaper methods of distilling water or generating steam has been ever on going. Now researchers from MIT and the Masdar Institute of Science and Technology, led by George Ni, describe a prototype design that boils water under ambient sunlight.

Central to their floating solar device is a “selective absorber”—a material that both absorbs the solar portion of the electromagnetic spectrum well and emits little back as infrared heat energy. For this, the researchers turn to a blue-black commercial coating commonly used in solar photovoltaic panels. The rest of the puzzle involves further minimizing heat loss from that absorber, either through convection of the air above it or conduction of heat into the water below the floating prototype.

But it’s probably not a last. The researchers used computer modeling to look for factors they could optimize, and they calculated that the device should make steam even at about half of direct sunlight’s full intensity. With that much wiggle room, they say that a cheaper, less effective absorber material could bring the cost down even more. The current design should only cost about $6 per square meter to make, and the researchers think they could reduce that to $2 per square meter. At that price, they estimate you could produce steam for about five percent of the cost of a system that has to concentrate sunlight.

You can read the article in its entirety on arstechnica.com.

HAARP Under New Management and You’re Invited to an Open House

August 27th, 2016

There have been rumors about HAARP since news broke about a year of two ago that people thought it was used in some sort of mind control array or whatever. Well it s now under new management.

The University of Alaska Fairbanks now owns and operates the High-Frequency Active Auroral Research Program and invites the public to an open house Saturday. This is interested visitors’ chance to learn about the scientific mission and research at the Gakona facility, which was transferred last year from the U.S. Air Force to UAF.

HAARP’s original purpose was to analyze the ionosphere and investigate the potential for developing ionospheric enhancement technology for radio communications and surveillance. But now that the University of Alaska Fairbanks has taken control of the station they intend to make the facilities available for researchers on a pay-per-use basis.

If I actually lived in Alaska (yeah, I know it’s big, let’s say Gakona) I would have considered spending my day there. The reason? They are holding an open to the public to an open house. This is gives interested visitors’ a chance to learn about the Gakona facility.

For nerdy Gakona residents this your chance to see the station for yourself. A chance I am betting doesn’t happen all that often.

“We hope that people will be able to see the actual science of it,” said Sue Mitchell, spokesperson for UAF’s Geophysical Institute, which operates the facility. “We hope to show people that it is not capable of mind control and not capable of weather control and all the other things it’s been accused of.”

And if you’re uncertain about attending, well let’s just say that the station isn’t capable of mind control else you wouldn’t have had a choice when it came to attending the open house.

25-Core Processor and it’s Open Source

August 27th, 2016

Researchers at Princeton announced at Hot Chips this week their 25-core Piton Processor. The processor was designed specifically to increase data center efficiency with novel architecture features enabling over 8,000 of these processors to be connected together to build a system with over 200,000 cores. Fabricated on IBM’s 32nm process and with over 460 million transistors, Piton is one of the largest and most complex academic processors every built. The Princeton team has opened their design up and released all of the chip source code, tests, and infrastructure as open source in the OpenPiton project, enabling others to build scalable, manycore processors with potentially thousands of cores.

See it for yourself.