Ubuntu Server Installing PHP 7 WITHOUT Apache

install php 7 ubuntu
install php 7.4 ubuntu
ubuntu install php no apache
install php ubuntu
php-fpm
php server linux
run php server linux
php web servers

I'm trying to get my server re-setup as a Lemp stack

The issue I am now running into is installing PHP 7 without Apache, since nGinx will be my webserver.

So, I've added ppa:ondrej/php. ran apt-get update, and tried to install just php7.0 via apt-get install php7.0

--nodeps flag does not work, as I am on Ubuntu 15.10

And I am presented with:

The following extra packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.0 libapr1
  libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 libqdbm14
  php-common php-readline php7.0 php7.0-cli php7.0-common php7.0-json
  php7.0-opcache php7.0-readline
Suggested packages:
  apache2-doc apache2-suexec-pristine apache2-suexec-custom php-pear
  php-user-cache
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.0 libapr1
  libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0 libqdbm14
  php php-common php-readline php7.0 php7.0-cli php7.0-common php7.0-json
  php7.0-opcache php7.0-readline

I do not want apache anywhere near my server, so how can I install php7 without it? Short of compiling from source (as this makes it difficult at best to keep it updated)

If you just request php7.0, it'll install Apache as default. Do apt-get install php7.0-fpm and it'll install as FPM instead, leaving something like nginx up to you.

How to install php without Apache webserver?, Ubuntu package details says php ( php7.2 ) depends on libapache2-mod-php7.2 OR php7.2-fpm OR php7.2-cgi . It seems to default to the first  Ubuntu package details says php (php7.2) depends on libapache2-mod-php7.2 OR php7.2-fpm OR php7.2-cgi. It seems to default to the first package, which itself depends on apache2. But if you install one of the latter first, and php afterwards, apache2 will not be installed.

Use the command:

sudo apt install php7.2 php7.2-common php7.2-cli php7.2-fpm

It will require the php7.2 dependencies in strict mode (WITHOUT apache2).

Installing PHP on Debian without Apache, When you apt-get install php5 on a Debian/Ubuntu server, you'll notice that APT will automatically install a bunch of apache2 packages as well. Install PHP 7.4 on Ubuntu 18.04. This guide let you learn how install the latest PHP version 7.4 on your Ubuntu system or your Ubuntu server on any VPS or any Cloud or any Dedicated hosting and configure it with Apache and Nginx. The latest PHP 7.4 version is officially released on November 28th, 2019.

On Ubuntu 18.04 I managed to do this successfully with:

sudo apt-get install php7.2-cli

How to Install PHP on Ubuntu 18.04, This is not very useful if you want to install a different web server, or no web server at all. Dependencies. Run "apt-cache depends php5" to see what dependencies  In this SIMPLE Updated Tutorial Learn How to Install PHP 7, 7.2, 7.3 on Ubuntu 18.04 with Apache or Nginx Find the easy way now!

Install PHP without Apache on Debian, Home · Web Servers; How to Install PHP 7, 7.2 ,& 7.3 on Ubuntu 18.04 or 7.3 on Ubuntu 18.04 including integration with Apache and Nginx. We will learn how to install PHP and set it to work alongside the Apache web server. Step 1 : PHP 7.4 is included in the default Ubuntu repository for 20.04.You can list each of the available PHP 7.4 packages with the following command:

How to Install PHP 7 on Ubuntu 18.04, We go a step further with showing you how to configure your Apache instance to Using PHP 7.2 on an Ubuntu server is highly recommended over previous Older versions like 7.0 and anything 5.6 and below are no longer  Install and configure PHP 7.1. If you want to install PHP 7.1, the latest stable release of PHP at the time of writing this article, on Ubuntu 16.04, a convenient method is to use the PPA (Personal Package Archives) repository.

How to Install PHP 7.2 on Ubuntu 16.04, to install and configure PHP 7, PHP 7.2 and PHP 7.3 on Ubuntu 14.04, 16.04, LAMP series, go to our How to Install and Optimize Apache on Ubuntu tutorial. no need to execute each command with 'sudo', but if you're not using the root  Install Apache on Ubuntu. Install php on Ubuntu. Install MySQL Server in Ubuntu. Install phpMyAdmin in Ubuntu. Install and Configure Apache web server on Ubuntu 18.04. Apache is the most popular and stable web server for Ubuntu Linux. The Apache HTTP server for Ubuntu 18 provided by the apache2 package. To install apache2 on Ubuntu, open the

Comments
  • Is compilation an option ? e.g. gist.github.com/tronsha/b471dd6d73dc8ebae242
  • exactly what I ended up doing (of course with more modules.. but you get the gist :) )
  • This was working perfectly for me up until a few weeks ago until today when I rebuilt my server, and now php7.0-fpm will not install via the ppa:ondrej/php repo, and gives the error - Couldn't find any package by regex 'php7.0-fpm'! :(
  • @DaveRix Try apt-cache search php and see what packages are there. IIRC the PPA maintainer moved some stuff around.
  • @ceejayoz - I've tried that, and only php5-fpm is listed, not the php7 version. I will need to try to contact the maintainer, as all the information I can find points to the same set of instructions, which are currently not working.
  • Will it install nginx?