Tutorial 2: How To Set Up Environment for Server-Side Scripting
To make things simple, you will create a development environment on your own PC using AMPPS, which is a solution stack of Apache, MySQL, MongoDB, PHP, Perl and Python for Windows NT, Linux and macOS. This desktop software stack includes everything you need for website development.
DOWNLOAD & INSTALL AMPPS
To make your
website visible to the world, it has to be placed on a web server. During the
development phase your own PC can act as a web server if you install AMPPS, which is free, easy to install and ideal for developing and
testing websites and web applications.
Here are the
steps to download and install this free software on your PC:
- Go to AMPPS site and download the version available for your operating system. I downloaded Windows 64 bit version 3.9 for my Windows 10 PC.
- After downloading, double click Ampps-3.9-x86_64-setup file to start the installation process.
Figure 5-1
- Accept
the license agreement and click Next
twice.
- Accept
the default installation folder and click Next.
Figure 5-2
- Accept
the Start Menu Folder and click Next.
- Click Next on the additional tasks
screen and then click on Install
on the final wizard screen. At this stage you will be asked to install
Microsoft Visual C++ Redistributable software. Accept the installation of
this software.
- Click Finish to launch the application. Click
OK if you see an update
notification. The AMPPS application will start as shown in the
following figure. It will start Apache, PHP,
and MySQL services. An icon of
this application will be placed on your desktop that you can use
subsequently to start the application before starting any development task.
DOWNLOAD & INSTALL VISUAL STUDIO CODE
Visual Studio Code is a lightweight but powerful source code
editor which runs on your desktop and is available for Windows, macOS and
Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for
other languages, such as C++, C#, Java, Python, PHP, and Go. Here are the easy steps to download and install this
software.
1. Go to Visual Studio site and choose the version for your OS. I downloaded 64 bit User Installer for my
Windows 10 PC.
2. Double-click the downloaded .exe file to start the installation.
3. Accept the license agreement on the first wizard screen and click Next.
4. Select the default destination location and click Next.
5. Accept the default Start Menu Folder and click Next.
6. On the Select Additional Tasks wizard screen, accept all the options
as illustrated in the following figure and click Next.
Figure 5-4
7. Click Install on the final
wizard screen.
8. Click Finish to complete
the installation process. Make sure that Launch
Visual Code checkbox is checked to immediately start the application.
TEST PHP
The development
environment is set on your computer. Let’s give it a try by creating and running
a small .php file.
1. In Visual Studio Code,
select New File from the File menu (A) and type the following
code (B).
2.
Select Save from the File
menu (A). Enter Hello for File name (C), select PHP (D) as its type and save this file in C:\Program Files\Ampps\www folder (E). From now on, you will place all your project
files under AMPPS www folder. Whenever you
create a project under AMPPS, the pages and folders for the project must go
into this folder.
3. Open a browser session and type
http://localhost/hello.php to see the text “Hello World” in the browser.
Comments
Post a Comment