0

I am trying to start learning php but I can not run the file.

<!DOCTYPE html>
<html>
<body>

<h1>My first PHP page</h1>

<?php
echo "Hello World!";
?>

</body>
</html>

This is the basic code and I saved it as test.php. When I type php -f test.php it gives me the error "Could not open input file: test.php". Thanks for your time.

Hamid Naghipour
  • 3,465
  • 2
  • 26
  • 55
  • 2
    Does this answer your question? [Running PHP script from the command line](https://stackoverflow.com/questions/10262532/running-php-script-from-the-command-line) – Kanad Apr 07 '20 at 05:11
  • 1
    Hi and welcome to Stack Overflow. Try starting PHP's internal web server: From the folder where your 'test.php' file is, run `php -S localhost:8088` (This will start the server on the port 8088). Then, open your internet browser and type `http://localhost:8088/test.php` in your address bar. You should see the hello world example. – Fel Apr 07 '20 at 14:23
  • go to your directory and try again – Ariful Islam Apr 11 '20 at 08:55

0 Answers0