Linux, Web Server & Database

Install PHP on Linux Server

Get the right PHP version and extensions installed and working with your web server.

The Problem

Your application needs a specific PHP version and a specific set of extensions, and installing the wrong combination — or forgetting to connect PHP to your web server properly — leaves you with a server that just downloads .php files instead of running them.

About this problem

PHP installation issues almost always come down to two things: getting the exact version your application needs (since distro repositories often ship an older default), and making sure the web server is actually configured to hand .php requests to PHP rather than serving them as plain text or triggering a download.

This comes up constantly when deploying an application with specific version requirements, or when a distro's default PHP is too old for a modern framework.

What's Included

What's NOT Included

How It Works

  1. Add the correct PHP repository (e.g. Ondrej's PPA on Ubuntu, or Remi on CentOS) for the version you need.
  2. Install PHP along with the specific extension list your application's documentation requires.
  3. Configure the web server to pass .php requests to PHP, either via mod_php or a PHP-FPM socket.
  4. Adjust key php.ini values (memory_limit, upload_max_filesize, max_execution_time) to sensible levels.
  5. Create a test script and confirm it executes correctly through the web server, not just the CLI.

In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.

Frequently Asked Questions

How do I know which PHP version I need?
Your application's documentation or a composer.json/requirements file usually states a minimum version — installing older than that commonly causes fatal syntax or function errors.
Why does my browser try to download my PHP file instead of running it?
That means the web server isn't configured to hand .php files to the PHP interpreter — it's treating them as plain static files instead.
Can I have two different PHP versions on the same server?
Yes, most distros support running multiple PHP-FPM versions side-by-side, each on its own socket, with different sites pointed at different versions.
What PHP extensions does WordPress need?
At minimum mysqli, gd or imagick, curl, mbstring, xml and zip — missing ones show up as specific plugin or media errors rather than a single clear message.
Why do I get a 'Class not found' error after installing PHP?
That usually means a required extension isn't installed or enabled — the class exists in an extension that PHP hasn't loaded, not in PHP's core.
Is it safe to use the latest PHP version?
Usually yes for new projects, but older applications sometimes use deprecated functions removed in newer PHP versions — worth checking compatibility before jumping several major versions at once.
Please note: the price shown applies to a standard case matching the description above. Every situation is different, and if your request falls outside the normal scope of this service, I will explain this before doing any additional chargeable work. I will never silently turn a small job into an expensive project.
Running into an issue with a service you've already bought, or unsure which one fits your problem? Message me directly on WhatsApp — no ticket system, no bot.