In Commandline

$which php


$php -v

PHP 7.2.10 (cli) (built: Sep 14 2018 07:07:08) ( NTS )

On Apache check phpinfo();


Apache Version  Apache/2.4.33 (Unix) PHP/7.1.16

I don't understand how apache decides the php path.

How can I make the apache to use the same php as commandline??


Check your Apache configuration file. There are a couple of things in it that may be used to point to where PHP resides. The first directive is PHPIniDir which may be set to tell Apache where PHP resides.

The other directive is LoadModule php7_module which tells Apache where to find the PHP module Apache should use.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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