35

Is it possible to install PHP5 without installing apache, in Ubuntu?

If so, how?

57
$ sudo apt-get install php5-cli  

Should do it.

| improve this answer | |
  • Care to explain? I understand why installing php5-fpm before php5 does the trick. But what php5-cli has to do with it? – x-yuri Jun 12 '17 at 20:48
  • 1
    php5-cli does not have apache as a dependency. – EEAA Jun 12 '17 at 20:50
18

Install php5 after php5-fpm if you plan to use nginx for example, because php5 needs one of either libapache2-mod-php5, libapache2-mod-php5filter, php5-cgi, or php5-fpm. Apt just picks the first package that satisfies the dependency.

$ sudo apt-get install php5-fpm php5
| improve this answer | |
  • That does the trick! – Tilman Nov 12 '15 at 23:44
  • 1
    This really is the much better answer. – Rob Apr 9 '17 at 19:35
-3

Yes, it is possible to install PHP5 without installing apache, in Ubuntu.

According to this answer: https://serverfault.com/a/243301/232590

sudo apt-get install php5-cli 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.