0

I am new to PHP . I have primarily worked on java. I want to run the helloworld program for PHP. I got it how to do it through blog

But I have got some basic questions :-

  1. Do I need to install both Apache and PHP separately or there is a way where Apache come bundled with PHP ? On google , I see to install LAMP but not just Apache bundled with PHP .
  2. Also in the mentioned blog, instruction did not to Apache where PHP is installed ? How it will know where PHP engine is ?
  3. Can I run PHP program without webserver something from CLI with execution Engine like Zend (like in java with JDK)?
asked Oct 21, 2018 at 7:11

1 Answer 1

1

To answer your question:

  1. If you are on Linux, I guess you need to install Apache, PHP separately by yourself (using those apt-get commands)

  2. After you have installed Apache, it will search for PHP via the httpd.conf file by default.

  3. Yes, if you want to run PHP as a script, you can run it in a terminal like /path/to/php somePhpFile.php

answered Oct 21, 2018 at 7:32
2
  • For poin 2, As you said After you have installed Apache, it will search for PHP via the httpd.conf file by default. , but in referred blog I did not see where they mentioned the path of installed php under https.conf file ? Commented Oct 21, 2018 at 9:18
  • Yes, there should be a line saying LoadModule php7_module /path/to/php/module Commented Oct 22, 2018 at 10:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.