How do you Install PHP5 without installing Apache in ubuntu?

12,675

Solution 1

$ sudo apt-get install php5-cli  

Should do it.

Solution 2

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
Share:
12,675

Related videos on Youtube

Ryan
Author by

Ryan

Updated on September 17, 2022

Comments

  • Ryan
    Ryan over 1 year

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

    If so, how?

  • Tilman
    Tilman over 8 years
    That does the trick!
  • x-yuri
    x-yuri almost 7 years
    Care to explain? I understand why installing php5-fpm before php5 does the trick. But what php5-cli has to do with it?
  • EEAA
    EEAA almost 7 years
    php5-cli does not have apache as a dependency.