I would like to set up Apache and PHP, but I think that, I have two versions of Apache, which is causing a conflict.
(I couldn't find a topic with the same problem, so If you have solved this problem before, please let me know the links. thanks)
I have OS X and If I run $ httpd -v I have Server version: Apache/2.4.23 (Unix) and for PHP $ php -v I got PHP 7.0.12
If I test in my browser just localhost it displayed "it works!
If I open the file sudo nano /etc/apache2/httpd.conf and activate (uncomment) the php module, I have this LoadModule php5_module libexec/apache2/libphp5.so (I uncommented the line)
Shouldn't be php7?
Additionally, If I open the file index.html located in cd /Library/WebServer/Documents and add the lines
<html>
<body>
<h1>It works!</h1>
<?php
$x = "Hello world!";
$y = 'Hello world!';
echo $x;
echo "<br>";
echo $y;
?>
</body>
</html>
and test again localhost in my browser, it only displays It works!
But If I select manually and open the file index.html under /Library/WebServer/Documents I got this:
It works!
"; echo $y; ?>
In this case PHP is not activated.
Could you please tell me, how to work with the right Apache 2.4 with PHP (version 7)
P.D. I know that another alternative is to use MAMP, but I would like to fix this issue becuase I wouldn't like to have other conflicts due to it
Thank you in advance!