March 11, 2020

PHP Server Basics: Overview and FAQ

PHP Development
Zend Server

PHP servers act as the foundation of many PHP applications, and range from simple servers to all-in-one PHP development platforms. In this blog, we look at PHP application servers, how they work, how they're different from PHP development frameworks and web servers, discuss how to find the right PHP app server, and answer frequently asked questions for teams just getting started with PHP.

Back to top

PHP Application Development Basics

To understand what a PHP application server is, it’s helpful to first understand PHP application basics. Let’s say I’m a developer who needs to create and manage a website. One of the first things I need to do is decide which programming language to use. I’ll share why I choose PHP as my go-to web app development language.

About PHP

  • Is a scripting language that’s easy to learn and use.
  • Includes more than 150 extensions that are ready-to-go compiled libraries for enabling functions in your applications such as database access, LDAP integration, and in-memory caching, which saves me a lot of time.
  • Supports the inclusion of code written in other languages including JavaScript, CSS, and HTML as well as C functions with the FFI functionality, which was introduced in PHP 7.4.
  • Works with numerous PHP development platforms, known as PHP frameworks.

What Is a PHP Server?

A PHP server — which is also called a PHP application server — provides a platform for running PHP applications.

Some PHP application servers are as basic as that. Others provide additional functionality such as clustering services, debuggers, and automated tools for application monitoring and web-server configuration, which can save a lot of time and reduce the need for numerous third-party or open source technologies.

If you're wondering what PHP is, get a quick overview in this blog.

About PHP Frameworks

PHP Frameworks — such as Laminas, Symfony, Laravel, and CakePHP — can dramatically accelerate development and improve code quality by providing pre-built modules, so you can:

  • Save time by skipping many tedious coding tasks.
  • Minimize errors, improve application stability, and boost security by using pre-tested code snippets.
Back to top

Choosing a PHP Application Server

Because most websites, web services, and business applications need to be available around the clock, it’s critical to choose a PHP application server that is highly reliable and easy to scale. Flexibility is also critical because PHP servers need to closely interact with web servers and databases. 

PHP application servers that provide built-in tools for developers are important to consider because they can:

  • Reduce the need for additional third-party or open source products, which can minimize costs and/or complexity.
  • Boost efficiency by enabling seamless workflows from one browser window. 

Why Choose Zend Server?

Zend Server provides a proven PHP application server platform that includes:

  • An industry-leading PHP debugger, as well as support for the open source debugger, xdebug.
  • PHP application deployment and monitoring tools.
  • The ZendPHP runtime, so you don’t have to download it from the community page and upgrade it yourself.  
  • Automated web-server configuration capabilities.   
  • Long-term, comprehensive support for PHP releases for at least five years, instead of the two years provided by the community. 
  • Mission-critical support, so your PHP applications are backed by experts, 24/7/365. 

Want to see all the tools you get with Zend Server? Try it for free for 30 days!



Back to top

PHP App Server FAQ

For teams new to PHP, there are some basic questions that need answered before they can choose the right technologies. See some of those questions, and answers, below.

Is PHP Server Side? 

Once I write my website application in PHP, I need a PHP (application) server to deploy it on. Unlike “client-side” applications that run on client devices such as desktops and mobile phones, PHP applications run on servers. So, PHP is server side. 

Are PHP Servers Web Servers? 

PHP servers are not web servers, although many people use the terms interchangeably. As noted earlier, PHP (application) servers, such as Zend Server, run applications written in the PHP scripting language.

Web servers, such as Apache and Nginx, manage requests from browsers to do things like: 

  • Display a website page written in PHP from a browser.
  • Open a file that you click on from a web page written in PHP.
  • Submit a form written in PHP that you completed.

To complete any of these requests from a browser, the web server will connect with the PHP (application) server, call the PHP script that contains the instructions it needs to complete the request, and then use the PHP runtime to fulfill the request.

What Is the PHP Runtime?

To complete any request to a PHP application, the web server that's connected to your PHP server uses the PHP runtime to interpret, analyze, translate, and execute the code needed to complete the request. 

Because the technology has evolved over time, there are many versions. However, you need to use the PHP runtime release that corresponds with the release of PHP your application is running. The current version is PHP 7.4.

Is the PHP Runtime the Same as Zend Engine?

Although PHP runtime is the name that people use to refer to the technology, the official, “under the hood” name is Zend Engine. That’s because the founders of PHP also created the Zend Engine and the company that managed it, which is now known as Zend by Perforce

Do You Need a Server to Run PHP?

Short answer, yes, or you need access to somebody else's server (cloud deployment being a prime example). 

The longer answer is that you need a machine that can run a system daemon/language runtime. This can be your personal development machine, but if you're running in production, you need a server. Beyond that, you will likely need a web server system process running as well (e.g., Apache or nginx or IIS). 

There are exceptions to that rule, including if you're running only CLI commands via PHP, or if you're using an async runtime such as Swoole, OpenSwoole, ReactPHP, or AMPHP, which are capable of acting as web servers themselves.

Additional Resources

Back to top