Where is php located in linux?

I have installed Apache and PHP. I know PHP works as I have tested a simple PHP file on an Apache server.

I'm writing a simple webserver which should be able to process PHP files. So once I get a request for a PHP file, I want to do something like 'exec php test.php' and get the output and pass it to the client.

As I'm not much into Ubuntu, I don't know where the PHP executable is [should be in \bin right?] to do it. But there is no PHP file inside \bin or \usr\bin.

When I run 'which php' it shows nothing. How do I do this?

Cancel reply
  1. September 10, 2021 at 12:13 pm

    Very good… this information saved me!

    Reply
  • February 17, 2021 at 8:22 am

    Thanks

    Reply
  • if[typeof ez_ad_units!='undefined']{ez_ad_units.push[[[300,250],'devanswers_co-large-leaderboard-1','ezslot_6',121,'0','0']]};__ez_fad_position['div-gpt-ad-devanswers_co-large-leaderboard-1-0'];

    Where is the PHP file located?

    user. ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. This file is located on your server in the /public_html folder.

    How do I know if PHP is installed Linux?

    Checking PHP version installed on your Linux and Unix server.
    Open the terminal prompt and then type the following commands..
    Login to the remote server using the ssh command. ... .
    To check PHP version, run: php --version OR php-cgi --version..
    To print PHP 7 version, type: php7 --version OR php7-cgi --version..

    How do I know if PHP is installed?

    1. Type the following command, replacing [location] with the path to your PHP installation. 2. Typing php -v now shows the PHP version installed on your Windows system.

    Chủ Đề