PHP
Jump to navigation
Jump to search
This is a quick introduction to PHP, which will be expanded on (eventually).
What is PHP?
PHP Hyper-text Pre-Processor. Allows web developers to write dynamically generated pages quickly. With synergy!
Basic PHP
- cd to your ~/public_html folder on Redbrick.
cd ~/public_html
- Create a file called “hello.php” using a text editor.
nano hello.php
- Paste (or manually type, if you're a newb) this PHP code into the fine
#!/usr/local/bin/php <?php echo “Hello World!”; ?>
- Save and exit (CTRL + O, CTRL + X)
- Set correct permissions for the php file (this must be done for every .php file you want to use).
chmod 700 hello.php
- Visit www.redbrick.dcu.ie/~username/hello.php to view your script's output.
- It should display “Hello World!” in plain text within your browser.