3
1 Comment

Setting up a complete PHP development environment on Windows

This article describes how to install a complete PHP development environment for PHP on Windows. The solution used is EasyPHP Devserver.

EasyPHP Devserver is a complete and ready-to-use development environment for PHP developers. It combines PHP, MySQL, Apache, PHPMyadmin, Xdebug and many modules and ad-dons (Xdebug Manager, Virutal Hosts Manager, Laravel & Laravel Manager, Code Sniffer, Codeshot, Codiadf, Mobile…) into a standalone, pre-configured installation that can be installed on your local computer or on a USB drive. Devserver is portable, modular, fully configurable and easy to update and extend.

Launched in 1999, EasyPHP Devserver was the first WAMP software bundle available. EasyPHP Devserver is more alive than ever with weekly updates, new modules created regularly and a strong community (more than 50.000 people use it everyday).

A. GETTING STARTED

1. Download Devserver

  • First, you need to download and install Devserver

2. Install

  • double-click on the downloaded executable
  • select an installation folder and follow the instructions

3. Post install

  • a shortcut to Devserver is created on your desktop
    Alt Text
  • use this shortcut to launch Devserver (or go to the install folder and click on run-devserver.exe)
  • when Devserver is launched, an icon appears in the Notification Area (next to the clock) - if you don't see the icon, click on Show hidden icons and move the icon next to the clock.
  • a right/left-click gives access to various menus Alt Text or Alt Text

Alt Text

4. Start HTTP Server

Two ways :

  • right/left-click on the icon in the Notification Area, click on Open Dashboard and under HTTP SERVER click on start.

Alt Text

  • if you don’t need to open the Dashboard, click on Servers > Start / Restart HTTP Server or Start / Restart All Servers (with this option the database server will start as well).

Alt Text

Alt Text

5. Start Database Server

Two ways :

  • right/left-click on the icon in the Notification Area, click on Open Dashboard and under DATABASE SERVER click on start
  • if you don’t need to open the Dashboard, click on Servers > Start / Restart Database Server or Start / Restart All Servers (with this option the http server will start as well).

B. SETUP YOUR ENVIRONMENT

Alt Text

Your files have to be stored in folders that the server knows. Two options: put them directly in the server document root (“Portable Directory") or use "Working Directories".

1. Option 1: "Portable Directory"

Use this option if you plan to use Devserver as a portable server. That means that Devserver is installed on a portable device (USB key, memory stick...) and you use it on several computers (for development, demo, presentation...).
Save your files in this folder: <server-install-folder>\eds-www and open them with your browser thru the Dashboard(Portable Directory section) or directly at this address: http://127.0.0.1/ (if you chose a port other than 80 use http://127.0.0.1:8080/ if 8080 is your port - change the value accordingly).

2. Option 2: "Working Directories"

Create the folder in which you want to store your files. This folder can be anywhere on your computer (drive C:, D:…).
Open the Dashboard with your browser (http://127.0.0.1:1111), click on + add directory
Fill the fields, click on save and wait a few seconds (servers need to restart if they were running).
Now, you can open your files with your browser thru the Dashboard (Working Directories section).

Alt Text

3. Your first page

There are many suitable code editors (text editors specialised for code with syntax highlighting). You can use Notepad++ (https://notepad-plus-plus.org/), Sublime Text (https://www.sublimetext.com/), Atom (https://atom.io/)...

Steps:

  • Open your code editor
  • Create a new file
  • Type the structure of an HTML page:

Alt Text

  • Add your PHP code (display the date for example):

Alt Text

Final code:

Alt Text

  • Save your page in the "Portable Directory" or in a folder declared in "Working Directories". Don't forget to give it the proper extension : .php. You can name your file date.php. Warning : be sure that your system shows file name extensions (read this).

  • Open your file with your browser thru the Dashboard. Your browser should display something like that:

The current date is Sunday April 2, 2017

4. Reminder

Devserver is not designed to be used as a production server, but as developing server to test your pages offline before moving them on the hosting server. Indeed, Apache for Windows is a test version, and is not guaranteed for an optimal operation (reliability, load rising, …) contrary to Unix/Linux based platforms.

posted to Icon for group Developers
Developers
on August 7, 2020
Trending on Indie Hackers
Your SaaS Isn’t Failing — Your Copy Is. User Avatar 57 comments Solo SaaS Founders Don’t Need More Hours....They Need This User Avatar 45 comments Planning to raise User Avatar 15 comments The Future of Automation: Why Agents + Frontend Matter More Than Workflow Automation User Avatar 13 comments AI Turned My $0 Idea into $10K/Month in 45 Days – No Code, Just This One Trick User Avatar 13 comments From side script → early users → real feedback (update on my SaaS journey) User Avatar 11 comments