How to install web server on Windows 10 (Apache 2.4, PHP 7, MySQL 8.0 and phpMyAdmin) 1. Downloading Apache, PHP, MySQL, phpMyAdmin. (we will install Apache, PHP. In this article, we will discuss “How to Setup Apache, PHP & MySql on Windows 10″. When you are planning to install Apache, PHP & MySQL on Windows 10 machine, then We have two options to do this as given below. There are different methods to install MySQL on Microsoft Windows. MySQL Installer Method. The simplest and recommended method is to download MySQL Installer (for Windows) and let it install and configure a specific version of MySQL Server as follows.
If you are into web development, then I know you already familiar with LAMP stack that contains Apache, MySQL, PHP and PhpMyAdmin (optional) on a Linux platform. Yes, there are a couple of applications that provide LAMP in single install package to test various kinds of web applications on Windows 10/8/7 such as XAMPP and WAMP. However, if you are on Windows 10 then you don’t need them, you can get the native performance of Linux with command line interface to download, install and manage LAMP packages. And here in this tutorial, we let you know how to install MySQL, PHP and phpMyAdmin on Windows 10 using Windows Subsystem for Linux.
The Windows Subsystem of Linux which is basically Linux compatibility layer on Windows 10 to run various kind of minimal Linux distro images with command line interface. Such as Debian, Ubuntu, Kali, Arch Linux, OpenSUSE, CentOS and more… Some of them are officially available on the Windows 10 Microsoft Store such as Ubuntu. Here first, we will download Windows 10 WSL Ubuntu and in further steps, we will understand how to set up Apache, MySQL, PHP and phpMyAdmin (LAMP stack) on it. Thus, let’s start the tutorial.
Step 1: Enable Windows 10 WSL for LAMP installation
Installing Windows Subsystem for Linux is not a big deal, we don’t have to download some third-party packages at all. Just search for “Turns Windows features on or off” in the search box of Windows 10. Then find an option Windows subsystem for Linux, select and click the OK button.
On this topic, you can see our step by step article on how to activate Windows 10 WSL.
Step 2: Download WSL Linux Distro
The second thing we need is the Linux Distro on our WSL to install MySQL, PHP and phpMyAdmin. Although there are various Linux apps are available on Microsoft Store but here we are installing the Ubuntu 18.04 WSL. So, in the Windows 10 search box, type Microsoft Store and there search for Ubuntu. When it appears, click on the Get button to install it.
Step 3: Run Ubuntu 18.04 WSL
After installing, the Ubuntu will available in Windows 10 applications, click on it to run. To start properly it needs to download some extra packages, thus it will take some time, hence, be patient.
Step 4: Run system update command
So, what we have now is exactly the Linux Ubuntu server in command line interface, thus the command will also be the same to install any Linux packages as we use in standard Ubuntu OS.
Although we have recently, installed the Ubuntu WSL distro, there will be a possibility of updates, thus first run the system update command:
Step 5: Install Apache on WSL
The first thing in a Linux based LAMP stack is Linux OS itself which already have setup above, now what we need is Apache web server. It is a light open source web server to run different web apps and websites. To install it on Windows 10 subsystem for Linux use the below command:
Install Php Mysql Windows Server 2012
Step 4: Installing MySQL on Windows 10 WSL
To install MySQL on Ubuntu Windows 10 WSL, here is the command:
Create a root user to use with phpMyAdmin later
Note: Change the green colour text i.e Username and password with whatever you want to assign.
Mysql Php Code
Step 5: PHP installation in Ubuntu Windows 10 WSL
Here we are installing PHP along with some important PHP extensions that you might need for your web projects.
Step 6: Install phpMyAdmin
Its time to download and install phpMyadmin on Windows WSL. We already have installed the main components of a LAMP stack that we need to install and run most of the PHP based projects on Linux. However, if you not much profound in database commands to manage it you should install phpMyAdmin too. Here is the command for that:
While installing the installer will ask for a couple of things.
Give some password for phpMyAdmin to register with the database server.
Choose the web server that you want to configure automatically with phpMyAdmin. As we have installed Apache thus use the Spacebar key to select the option apache2 and then press the Enter button.
Congifure the database for phpmyadmin.
When it asks for database user then simply type the one we have created above. In our case, it is h2s and you have to enter your created one.
Php On Windows Server 2012
Step 7: Test Apache and phpMyadmin
After performing all the above steps, its time check whether everything is working or not. For that first, we have to know what is our Ubuntu WSl IP address. Use the below command:
Now open your browser and type your system IP which you find in the above step. In our case, it is 192.168.43.93 and must be different in yours.
Test and Login to phpMyAdmin
To access the installed phpMyAdmin, type your system IP along with phpMyAdmin directory name as:
or
or using the local IP address, in our case it is:
60 Month License SuspensionPlate Confiscation and Ignition Interlock Devices for Repeat OffendersDrivers convicted of a second or subsequent DUI will forfeit their license plates to the courts during the period in which the driver license is suspended.
When the login screen appears then type the root user for Database created above along with its password.
Here is the Dashboard phpMyAdmin.
PHP 5.2.9.2 Install on XP Pro IIS 5.1 - phpinfo( ) results incorrect
Testing Date: 05.15.09
Background:
For several days now I, as a newbie, have been unsure if I had installed PHP correctly, or not. No matter what I did phpinfo( ) reported 'Configuratin File Path' as: “C:WINDOWS”. I was left to wonder what was wrong.
To help resolve the phpinfo() “issue”, I conducted a series of tests using two scripts:
The first is “test-php-ini-loaded.php”; it is stored in c:inetpubwwwroot, and has the following code:
<?php
$inipath = php_ini_loaded_file();
if ($inipath) {
echo 'Loaded php.ini: ' . $inipath;
} else {
echo 'A php.ini file is not loaded';
}
?>
The second script is simply calls phpinfo( ). It is named test.php, is stored in “c:inetpubwwroot”, and has the following code:
<?php phpinfo( ); ?>
My Dev Environment:
1. Windows XP Pro SP3
2. IIS 5.1 / MMC 3.0
3. PHP 5.2.9.2 – phpMyAdmin not yet installed
4. (plus MySQL 5.1, etc.)
5. Install location is on my local E: drive
The Tests:
Test 1:
a. PHPRC environment variable and IniFilePath Registry left in place and active
b. Verified no other copies of php.ini exist on the system other than in my E:PHP folder
c. Renamed php.ini to hold-php.ini
d. Stopped and started IIS (“net stop iisadmin” and “net start w3svc”)
e. Ran “test-php-ini-loaded.php” to check whether my php.ini is loaded. It is not.
f. Ran 'test.php'. “Loaded Configuration File” was empty, while “Configuration File (php.ini) Path” showed: C:WINDOWS.
Test 2:
a. Moved php.ini from E:PHP to C:WINDOWS
b. Stopped and started IIS
c. Ran 'test-php-ini-loaded.php' to check if my php.ini is loaded. It is not, which surprised me.
d. Ran 'test.php'. My php.ini is apparently not loaded, or found, by phpinfo( ), even though “Configuration File (php.ini) Path” reports it as being in C:WINDOWS.
e. Note: Per PHP’s “The configuration file” note, PHP's search order includes: “Windows directory (C:windows or C:winnt) (for Windows), ..”; but it apparently doesn’t or php.ini would have been found and displayed at “Loaded Configuration File”.
Test 3:
a. Left the solo copy of my php.ini in C:WINDOWS
b. Disabled PHPRC environment variable by renaming it to “Ex-PHPRC and saving the settings (note: for this test I left the Registry entry for PHP IniFilePath intact)
c. Stopped and started IIS
d. Ran 'test-php-ini-loaded.php' to check whether my php.ini is loaded. Predictably it is not found.
e. Ran the 'test.php'. Again, my php.ini file is reported as not found in C:WINDOWS though “Configuration File (php.ini) Path” reports it as being there.
Test 4:
a. To be thorough and eliminate all possible sources of “mis-direction” I deleted the PHP IniFilePath Registry entry (after backing up the Registry). The PHPRC environment variable was left disabled.
b. Stopped and started IIS
c. Ran 'test-php-ini-loaded.php' to check whether my php.ini is loaded. Predictably it is not.
d. Ran 'test.php'. Again, no change. My php.ini file is not found “Configuration File (php.ini) Path” reports it as being there.
Conclusions:
The first conclusion I came to is that, in the default download version of phpinfo( ), “Configuration File (php.ini) Path” is hard-wired to report C:WINDOWS whether php.ini is there or not. Further, that C:WINDOWS is not a default search location (at least not on XP).
However, given an otherwise “proper” setup, phpinfo() reporting C:WINDOWS as the value for “Configuration File (php.ini) Path” is merely misleading and is not actually harmful or indicative of a failed installation.
Thanks go to Peter Guy of www.peterguy.com who suggested the testing, and to Daniel Brown of www.php.net for some initial guidance.
P.S. This note is not meant to take anything away from PHP. It is a fine tool. The sole purpose of the testing was to confirm that my installation of PHP was correct.