What is PHP?
Unless you have a static HTML site, you’ll need to use scripts and applications to serve up your website content.
PHP stands for PHP Hypertext Processor, and it’s designed to make dynamic websites easier to create. It’s primarily available on Linux web hosting plans.
How Do You Know If You Need PHP Hosting?
You want a web hosting provider that supports PHP if:
- Your blog or business website relies on a content management system (CMS), like WordPress, or
- If you need to protect your site’s code and customer information behind a robust line of defense.
PHP’s open-source code and versatility make it a popular web hosting offering for most providers.
Where Do I Install PHP?
Does PHP Hosting Cost More?
PHP should not add any additional cost to your web hosting fees, but it’s always a good idea to confirm support for this (or any other) application with your host when choosing a plan.
How PHP Changed the Web
In the early days of the web, content was created in text editors using raw HTML. Occasionally, a page creator would throw in a bitmap image to liven things up.
With the advent of PHP, websites became more dynamic, more responsive and faster to create.
Different Versions of PHP
PHP was originally rolled out in 1995, and the most important subsequent release was arguably version 5. In total, it took five years for PHP to become a common feature on web hosting accounts.
- PHP 4: Released in 2000, PHP 4 was a powerful programming language with limited object-oriented functionality. Although you can find PHP 4 around, it is no longer supported officially, and for any public coding, you should transition to version 7.
- PHP 5: Released in 2004, PHP 5 introduced a more sophisticated approach to object-oriented programming and better security. As of 2019, it is no longer supported.
- PHP 6: Shortly after the release of PHP 5, efforts began to make PHP fully Unicode supported. This effort failed and PHP 6 was never released.
- PHP 7: This is the current version of PHP, which was first released in late 2015. It is at version 7.4 of PHP.
- PHP 8: The next release of PHP is expected in 2020 or 2021 and will include just-in-time compilation and many other new features.
Why Use PHP?
PHP connects HTML pages to dynamic content from databases and multimedia applications, making it easy to create interactive content.
There are many reasons to use PHP to develop your site:
- It’s favored by beginners because it can be incorporated into HTML documents. The PHP interpreter will only read the items enclosed within delimiters. Everything else is processed as regular HTML. This makes it easy to add small dynamic chunks of code to an existing site.
- It’s a lightweight option that can be run on all kinds of hosting accounts.
- Finding a PHP web host is relatively easy; PHP is free, so most hosts included it in their hosting plans.
- It allows you to pull content from a database, meaning that one-page template can be populated with different content.
- PHP can’t be read by the visitor, to it’s ideal for secure applications, such as authorization and payment processing.
- If it’s not installed, you may be able to install it yourself through your control panel.
- You’ll need PHP to run WordPress and many similar applications.
What to Look for in PHP Hosting Plans
Most hosting packages come with PHP support at no extra cost — including free web host plans or inexpensive shared plans that offer an unlimited resource allocation and a free domain name.
These plans most likely also include a range of PHP scripts that you can install to enhance your website. Many hosts also provide technical support for such scripts, which is not the case if you decide to use a less commonly-used language.
As such, you can rest assured that you’ll find a great PHP hosting option at a price you can afford.
Looking for quality PHP hosting at bargain prices?
A2 Hosting normally scores at or near #1 in our speed and performance tests. Currently, you can save up to 50% on their developer-friendly plans. Simply use this discount link to get the deal.
How to Learn PHP
Learning PHP is simple; there are lots of little tutorials that will help you get started, like:
PHP Hosting Caveats
While many web hosts support PHP, it’s crucial to check which versions they support before you purchase a web hosting package.
WordPress Recommends Prompt PHP Updates
WordPress, a content management system that is a major driver of PHP support in web hosting, recommends that you select an option that upgrades to the latest version of PHP to ensure a secure environment.
Why Some Hosting Companies Delay PHP Updates
However, some hosts are loath to upgrade immediately (or even soon after) a new release, since they aren’t certain that the new version won’t be “buggy.” As such, you’ll also want to check the host’s upgrade policy.
PRO TIP: To protect your site’s security, make sure to keep PHP updated to the latest version.
Linux vs Windows for PHP
PHP was originally written for Linux web servers, but it can now be installed on most operating systems and platforms. It’s possible to run PHP version 7.2 and above on Windows web servers offered via your hosting provider.
Why Choose Linux Hosting for PHP?
However, there are a few secondary reasons why you might not choose Windows when it comes to PHP web hosting and running PHP scripts:
- Historically, Linux and PHP are closely linked. Finding support for scripts running on Windows servers can be difficult.
- There’s more work involved for the web hosting company, so they might not be so keen to support it.
- Windows hosting usually costs more, so it’s better not to choose it unless you have a particular reason.
Linux powers the majority of sites on the web. Don’t choose a Windows server if you don’t need it for any other purpose since Linux and PHP are a great combination.
PHP Development Hosting
If you want to do more than simply run a PHP-powered CMS, like develop your own software — standalone or extensions to existing applications — there are a few more things you should look for in PHP hosting.
The most important hosting features for developers are access to FTP and SSH. FTP allows you to easily upload your code to the server. All hosts offer this to some extent, but you don’t want to be limited to a control panel interface. And if you work with others, you may need additional control.
SSH allows you to log in to your server and work on it just as if you were sitting in front of it. With it, you can conceivably do your coding right on the server without having to upload it. SSH access is more limited in hosting plans so if you need it, be sure to check with any prospective hosts before you sign up.
In addition to these features, there are many things you may want depending upon the work you are doing. It could be helpful to have SSD storage, an SSL certificate (for encryption), access to a CDN, and anything else that is necessary for your project. You might also need access to other languages like Python and Ruby.
PHP Terminology and Acronyms
When buying a hosting account for PHP support, you may come across some of the following terms and abbreviations:
- PHP: A recursive acronym. It stands for PHP Hypertext Processor. Originally, it stood for Personal Home Page.
- Foo: Foo is a term used as a placeholder or wildcard. You’ll see it on PHP forums, in working code, and in examples online.
- PEAR: The PHP Extension and Application Repository, a code library that simplifies and speeds up web development.
- LAMP: A common hosting set-up: Linux, Apache (webserver), MySQL (database) and PHP. LAMP is sometimes referred to as a “LAMP stack,” or a solution stack.
- Zend: A software company that develops PHP applications. Its products include the Zend Engine, the driving force behind the execution of PHP code.
Our Choices: The Top Three PHP Hosts
|Storage||10 GB||50 GB||Unmetered|
SiteGround bills itself as web hosting that’s been “crafted with care,” and we agree. In addition to offering a full slate of feature-rich options at a variety of price points, they treat their customers well (over 2,900 customers have contributed to its 4.8/5 star rating).
They also own datacenters on three continents, implements technology to ensure top-notch performance, and offer an uptime guarantee of 99.9%.
Bluehost is known for its close collaboration with and optimal support for WordPress, but the host offers a myriad of options that will appeal to those looking for web hosting (regardless of whether they’re using WordPress or not).
They are a solid provider of full-featured hosting plans at a range of prices and offer 24/7 support, a money-back guarantee, and extras such as marketing credits with all purchases.
If you want a web hosting package that is as easy to use as possible and you want to get your website up and running with little hassle, iPage is the host for you.
Though iPage’s plans aren’t as robust as those offered by SiteGround and Bluehost, you will still get everything you need to launch your website.
What makes iPage hosting stand out, however, is the configuration of its administrative areas. iPage strives to make website management as easy as possible for you.
PHP Hosting Pros and Cons
Like all languages, PHP has its good and bad points. Here are the main things in both categories to think about.
- PHP is lightweight, easy to learn and use, and cannot be read by end-users, so you can use it for secure apps.
- PHP is commonly-supported, so you don’t have to upgrade to an advanced hosting option, such as VPS or dedicated hosting, to support your website or apps.
- If parts of your app/website require Windows-only tools, you may have a hard time finding a solid hosting option that meets all of your requirements.
- Although PHP has made great strides since its humble beginnings, it is still relatively easy to write insecure code. Programmers should know what they are doing.
More PHP Resources
Other features in Languages and Frameworks
- .NET Framework
- Ruby on Rails
- Server Side Includes
- PHP 5
- PHP 7
Looking for a great deal on PHP hosting?
SiteGround — rated #1 by our readers — provides excellent customer support and fast, secure PHP hosting. Right now readers can save up to 67% on their popular plans. Use this discount link and get online today.
PHP Frequently Asked Questions
- What is PHP?
PHP is an interpreted scripting language used to create dynamic web applications. The language is extremely powerful with libraries that allow coders to interact with databases, alter images, communicate with other web servers, and much more. As a result, it is the basis of a vast number of web applications.
- What is an interpreted scripting language?
An application written in an interpreted language is processed in its original form. This is in contrast to code written in a compiled language which must be converted into executable machine code before it is run. The distinction between interpreted and compiled scripting languages is becoming less and less clear.
For example, PHP can be both interpreted and compiled. HHVM (HipHop Virtual Machine) is a relatively new execution engine for PHP that compiles and then translates PHP into machine code prior to execution, effectively treating PHP as a compiled language rather than an interpreted language.
- What is a dynamic web application?
A dynamic web application is a web page (or a collection of web pages) that pulls information out of a database or changes the content of the page based on user input, in contrast to a static website that simply displays non-changing content.
- Are scripting languages less powerful than compiled languages?
A scripting language is no less powerful than a compiled language — at least in theory. Compiled languages can, however, be substantially faster. And generally speaking, the kind of low-level coding done when building an operating system is limited to compiled languages. But that doesn’t mean that scripting languages are not powerful.
PHP is a complete programming language. From the standpoint of building web applications, you can do pretty much anything you need with it. And using a more “powerful” language like C++ for creating a web page would be a terrible idea because it is powerful in a way that isn’t consistent with the needs of that effort.
- What does PHP stand for?
PHP was originally an acronym for “Personal Home Page” tools. With the release of PHP 3, a recursive acronym was invented and PHP now stands for “PHP: Hypertext Preprocessor.” Try not to think about it because as recursive acronyms go, it’s not very good.
- Why are so many popular applications written in PHP?
PHP has been included as part of the industry-standard web server configuration referred to as the LAMP stack (Linux, Apache, MySQL, and PHP, Perl, or Python) since the late 1990s. Its ubiquity, open-source roots, and ease of use make it a natural fit for the web.
PHP has somewhat fallen out of favor with modern web developers. However, the massive installed PHP base and the fact that popular applications such as WordPress are written in PHP mean that it isn’t going anywhere soon.
- Is PHP popular?
PHP is incredibly popular. Part of this is due to the great many web applications (eg, WordPress) built on it. But another part is that it has always been an easy language for people to pick up. Some people dislike it for technical reasons and it has a history of security issues. But PHP has been greatly improved over the years and PHP 7 is a solid language.
- Do I need PHP?
Many modern web applications such as content management systems and e-commerce platforms are written in PHP. If you’re planning to use a PHP application it is important that your web hosting provider supports the language. Additionally, there are a number of PHP modules that might be needed by any particular program.
Virtually all hosting plans include PHP. However, you should research the specific modules and PHP version requirements of the applications you plan to use and then check with your web host to verify that they can meet these requirements.
- Do I need to learn PHP?
You only need to learn PHP if you’re going to create or modify PHP applications. You do not need to know PHP to use most popular PHP applications such as WordPress and Joomla. Although, knowing at least basic PHP will help you troubleshoot any issues you run into when using an application. And PHP is relatively easy to learn.
- Who should learn PHP?
Virtually all web developers should know PHP. It’s the most common server-side language, so web developers are almost certain to run into it on a regular basis. It’s also relatively easy and natural to learn with a lot of good tutorials and other educational materials available online.
A lot of web developers get their start working on WordPress, Joomla, or Drupal – all written in PHP. It’s a natural progression for a budding developer to go from tinkering with a WordPress theme to modifying a basic plugin, to developing their own themes and plugins.
- How do I display static HTML as part of a PHP script?
PHP was designed to be mixed with HTML. In a PHP script, you can jump back and forth between writing HTML and PHP with special delimiters. In addition, you can use the functions echo and printf to print HTML from within PHP code. This makes PHP much easier to work with than other languages for creating web applications.
- What is a PHP framework?
A PHP framework is a set of classes designed to make development faster and more secure. Each PHP framework includes a different set of classes and is designed with different development goals in mind, so picking the right framework is important.
The most popular PHP framework is Zend, which is developed by the same company that underwrites the development of PHP. Two other popular frameworks are Laravel and CodeIgniter, and there are dozens of other PHP frameworks that can speed up your development and help ensure that you follow best coding practices.
- What’s new in PHP 7?
The most important upgrade in PHP 7 is speed. In benchmarked tests, PHP 7 has been demonstrated to be at least twice as fast as the previous version of PHP, version 5.6. PHP 7 also includes enhancements to error handling, variable type declarations, a more secure random number generator, limited Unicode support, and a new spaceship operator that can be used to test for the relationship between two values.
- What happened to PHP 6?
Quite a bit of work was done developing PHP 6 with the goal of adding complete native Unicode support to PHP. However, the project faltered and some of the work was eventually pushed back into minor version releases of PHP 5 while full support for Unicode was never added.
When work on the next version of PHP began, originally called PHP Next Generation (phpng), the decision was made to name the version PHP 7 to avoid creating any confusion as to whether or not the features tabbed for inclusion in PHP 6 had been included.
- Can I use PHP 5?
Yes, but you shouldn’t. The final version of PHP 5 was 5.6 which was released in August of 2016. It received active support for both bug and security fixes through January of 2017 and then critical security updates through the end of 2018. As a result, you should not use PHP 5.
- Is PHP secure?
PHP can be used to build secure web applications. However, it is also quite easy for inexperienced developers to introduce significant security holes into their web applications if they aren’t careful. If you’re building a publicly-accessible web application, take the time to educate yourself about the most common security threats that PHP developers face and make sure you have protected against these pitfalls in your codebase.
- How do I get PHP?
PHP is pre-installed on virtually all managed web servers. However, if you’re going to manage your own VPS, cloud, or dedicated server, then you may need to install it. There are many different ways to do so depending on the operating system and software on your server.
In general, you’ll install PHP by connecting to your server over SSH and running a series of commands. Detailed installation instructions are available from the official PHP website: PHP.net.