PHP

From StudentDevWiki

Jump to: navigation, search

PHP is a language designed for server-side production of dynamic web pages, meaning that whenever someone visits your PHP page, the code is executed, and the output of your program, usually HTML-formatted text, is sent back to the user. Because it is so popular for modern web development, we're dedicated to maintaining a full-featured and up-to-date PHP environment.

Getting Started

To create your PHP script, use your text editor of choice to create a file called test.php in your web directory (~/public_html directory by default). A simple test file might look like this:

Hello
<?php
   echo "World";
?>

Using your terminal or FTP client, make sure that the permissions are set to 644 (user: read/write, group: read, everyone: read). This permission level is necessary because a security feature of the webserver will prevent your script from running if anyone besides you can edit your program.

At the terminal:

user @ Bifrost : ~/public_html ::chmod 644 test.php

In an FTP client, you can usually right-click on the file and choose the options specified above.

Now you can view the output of your file at http://yourwebsite.myrpi.org/test.php

Environment

myRPI runs PHP 5.2.4. For more information, feel free to take a look at our phpinfo().

More information

Retrieved from "http://wiki.myrpi.org/PHP"
Personal tools