Jump to content

PHP: Difference between revisions

188 bytes removed ,  28 September 2010
Remove legacy information.
(Remove legacy information.)
 
(One intermediate revision by one other user not shown)
Line 14: Line 14:
  cd ~/public_html
  cd ~/public_html


* Create a file called “hello.php” using a text editor.
* Create a file called ''hello.php'' using a text editor.


  nano hello.php
  nano hello.php
Line 20: Line 20:
* Type this PHP code into the file
* Type this PHP code into the file


#!/usr/local/bin/php
  <?php
  <?php
     echo "Hello World!";
     echo "Hello World!";
  ?>
  ?>
Notice the use of the hashbang (or shebang - yes, make all the jokes you want), which must be present at the top of every PHP file.
#!/usr/local/bin/php


* Save and exit (CTRL + O, CTRL + X)
* Save and exit (CTRL + O, CTRL + X)