NOTE: I’m using apache2 on Linux with PHP 5
Suppose I had this simple hello_world.php file:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World </p>'; ?>
</body>
</html>
…and I wanted to display it on my apache2 server. How do I do this, and where do I move the source code? Thank you in advance
You have to move your files in /var/www and make sure Apache is launched.
Run the following command in a terminal :
sudo /etc/init.d/apache start
After launch your browser (ex: Chrome) and type “localhost/hello_world.php” in your url adress bar.