Some Questions on PHP execution?

by user3198603   Last Updated October 21, 2018 08:05 AM

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)?


Answers 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

Blue Fishy
Blue Fishy
October 21, 2018 07:32 AM

Related Questions



Does a PHP programmer need ZCE certification?

Updated August 08, 2016 08:03 AM