PHP Server Installation
PHP Server Installation
z
PHP Environment
Setup
z Install PHP
To install PHP, we will suggest you to install AMP (Apache, MySQL, PHP)
software stack. It is available for all operating systems. There are many AMP
options available in the market that are given below:
• WAMP for Windows
• LAMP for Linux
• MAMP for Mac
• SAMP for Solaris
• FAMP for FreeBSD
-every file you will be created must be end with (.php) extension. You can also
download text editors like: Notepadd ++, Brackets, sublime, etc. for better coding. In
my case, Im using brackets. But if you don’t have any text editors available you can
use notepad.
z
Step 6. Now let’s create our first php
script.
-open the hello_world.php file and write your first php script.
Generally, a PHP file contains HTML tags and some PHP scripting code. It is very easy to create
a simple PHP example. To do so, create a file and write HTML tags + PHP code and save this file
with .php extension.
z
Your script looks like this:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
Step 7. Now to see if your code is working. Open any
z web browser and run your first script.
To run your php scripts you must input the server name followed by your folder name
then your php file name.
localhost/php-oop/hello_world.php
It works!
z
Note: Don’t forget to run your server before you work on
with your scripts or else it will not work.