Skip to main content

Setting up a Development Environment for PHP and MySQL

Learn to setup a development environment on a PC to support the development and testing of PHP and MySQL projects.

Introduction 

The development environment is the location where you write and test your web applications before uploading them to the staging environment and then to the production environment. The most common location for your development environment is your own computer. This walk-through shows you how to set up a development environment on a PC for development of web applications using PHP, MySQL, and Apache. 

 

Software

The target development environment will consist of the following five software components:
  • Web Server - Apache
  • Database Server - MySQL
  • Web Programming Language - PHP
  • Database Management Tool - phpMyAdmin
  • Integrated Development Environment (IDE) - Net Beans.

 

Install from an All-in-One Package

 Installing the software from an all-in-one package is faster and easier. For a Windows computer, there is a free package called XAMPP that you can download from Apache Friends.

XAMPP stands for Cross-platform, Apache, MySQL, PHP and Perl. Within a few mouse clicks, you can install Apache, MySQL, PHP, and phpMyAdmin on the PC. XAMPP was created primarily as a PHP development environment for Windows computer.

Install each Software Package Separately

If you are braver, you can also download and install Apache, MySQL, PHP, and phpMyAdmin software separately on your PC. They are downloadable from their respective websites:
This walk-through will use the XAMPP all-in-one package.

Install XAMPP

Download the XAMPP for Windows Installer. Double-click the downloaded exe file to start the installation. When prompted, just leave every option to default. By default, the installer will extracts all the necessary files to a new folder at c:\xampp.

 After successful installation, you should find an XAMPP icon on your desktop, double-click it to launch the XAMPP Control Panel as shown in Figure 1. Alternatively, you can locate c:\xampp-control.exe, the control panel program, and drag a shortcut to the desktop.

  

On the XAMPP Control Panel, click the Start buttons for Apache and MySQL. Messages that they have started successfully are displayed, and the labels on their respective Start buttons changes to Stop. (Figure 2) 

 

Click the Admin button for the Apache server, or alternatively launch a browser and enter http://localhost/ into the address bar. If everything has been correctly set up, you should see the following main admin page on the browser. (Figure 3)

 

  

The menu on the left of the main admin page gives you web-based access to the various components of XAMPP.
Click the phpinfo() link under the Php section of the menu on the main admin page. You should see a page showing PHP configuration information below. (Figure 4)


 

Click the phpMyAdmin link under the Tools section of the menu on the main admin page, or type http://localhost/phpmyadmin on a browser address bar. This will launch the phpMyAdmin page for managing the MySQL database server. (Figure 5) You can also launch the phpMyAdmin through the Admin button beside MySQL on the XAMPP Control Panel.

 

You have been able to launch the above pages without being prompted for logging in. Your development environment is not secured. Everyone can access your XAMPP pages through the network.
Click the Security link under the Welcome section of the menu on the main admin page. You should see the XAMPP SECURITY page below. (Figure 6)


 Click the red link http://localhost/security/xamppsecurity.php on the XAMPP SECURITY page to navigate to the Security Console to create log in accounts for MySQL and XAMPP. (Figure 7) 

 

After this, you will be prompted to log in when you attempt to access the XAMPP pages through the network. Access to phpMyAdmin page will also requires log in. (Figure 8)

 

 Install NetBeans

You can read about netbeans from https://netbeans.org/features/php/

Download it from https://netbeans.org/downloads/

 

Thanks !! 

Comments

Popular posts from this blog

HTTP Server : Apache

Apache is a open source HTTP web server. It handles HTTP Requests sent to it and then it is able to them. Apache is comprised of Two main building Blocks with the Latter being comprised of many other little building blocks. The Building Blocks are the Apache Core and then the Apache Modules that in a sense extend the Apache core. What is a Web Server?  A Web Server is any Machine that receives requests from a client machine and is able to turn around process the requests and send back a response. This is usually in terms of a Web Server to send back a Web pages when people what to go navigate to a webpage that is hosted on that server now one may ask how do you send and receive the information to and from the server. This is where HTTP begins to play a role into how this all goes about. What is HTTP? HTTP Protocol: HTTP stands for H yper- T ext- T ransfer- P rotocol This is the protocol that is used in order to send and receive information from the server. This is...

Web technology

The open nature of the World Wide Web presents incredible opportunities for people who want to create websites or online applications. To take full advantage of the web's capabilities, you need to know how to use them. Web technologies   Basics HTML HyperText Markup Language (HTML) is used to describe and define the content of a webpage. CSS Cascading Style Sheets (CSS) are used to describe the appearance or presentation of content on a webpage. HTTP Hypertext Transfer Protocol (HTTP) is used to deliver HTML and other hypermedia documents on the web. Scripting JavaScript JavaScript is the programming language that runs in your browser. You can use it to add interactivity and other dynamic features to your website or application.