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 :-
- 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 .
- Also in the mentioned blog, instruction did not to Apache where PHP is installed ? How it will know where PHP engine is ?
- Can I run PHP program without webserver something from CLI with execution Engine like Zend (like in java with JDK)?
1 Answer 1
To answer your question:
If you are on Linux, I guess you need to install Apache, PHP separately by yourself (using those apt-get commands)
After you have installed Apache, it will search for PHP via the httpd.conf file by default.
Yes, if you want to run PHP as a script, you can run it in a terminal like /path/to/php somePhpFile.php
-
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 ?user3198603– user31986032018年10月21日 09:18:37 +00:00Commented Oct 21, 2018 at 9:18 -
Yes, there should be a line saying LoadModule php7_module /path/to/php/moduleBsonjin– Bsonjin2018年10月22日 10:05:42 +00:00Commented Oct 22, 2018 at 10:05