How to check the presence of php and apache on ubuntu server through ssh

后端 未结 5 1537
萌比男神i
萌比男神i 2021-02-02 06:18

How can I check whether apache is installed with php and mysql on Ubuntu server through ssh?

Also if it is installed, in which directory?

And if in case some ot

5条回答
  •  生来不讨喜
    2021-02-02 06:59

    Another way to find out if a program is installed is by using the which command. It will show the path of the program you're searching for. For example if when your searching for apache you can use the following command:

    $ which apache2ctl
    /usr/sbin/apache2ctl
    

    And if you searching for PHP try this:

    $ which php
    /usr/bin/php
    

    If the which command doesn't give any result it means the software is not installed (or is not in the current $PATH):

    $ which php
    $
    

提交回复
热议问题