Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu Server Installing PHP 7 WITHOUT Apache

Tags:

php

nginx

ubuntu

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)

like image 817
Kevin Avatar asked Jan 19 '16 15:01

Kevin


People also ask

Can we install PHP without Apache?

Just sudo apt install php will do.

How do I install PHP on Ubuntu?

PHP installation on Ubuntu systems is pretty straightforward. You just need to add the required PPA and you can install any PHP version on the Ubuntu system. Add the Ondrej PPA to your system, which contains all versions of PHP packages for the Ubuntu systems. Now, update the Apt package manager cache.


1 Answers

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.

like image 109
ceejayoz Avatar answered Sep 17 '22 04:09

ceejayoz