UwAmp

Documentation

UwAmp 4.0.0 · Windows 10 / 11 64-bit

Getting started

  1. Download the light or full version and unzip it anywhere: C:\UwAmp, D:\dev\UwAmp, a USB stick… UwAmp must be able to write to its folder: avoid C:\Program Files.
  2. Double-click UwAmp.exe. There is nothing to install: no Visual C++ runtime, no .NET, no Windows service.
  3. With the light version, UwAmp offers to install Apache, PHP, MariaDB and phpMyAdmin on first launch. One click is enough; it then starts the servers.

If Windows shows “Windows protected your PC”, click More info then Run anyway. This message appears for recent programs with few downloads.

AddressContent
http://localhost/your sites (www folder)
http://localhost/mysql/phpMyAdmin
http://localhost/uwamp/phpinfo.phpphpinfo() of the active PHP version
https://localhost/the same sites over HTTPS (see Local HTTPS)
127.0.0.1:3306MySQL / MariaDB, user root, password root

Minimizing the window sends UwAmp to the notification area, where its icon shows the server status. Closing UwAmp stops the servers, after confirmation. These behaviours, starting with Windows and starting the servers automatically are set in Settings.

Folder layout

UwAmp\
  UwAmp.exe, uwamp.ini        the program and its settings
  www\                        your sites (root of http://localhost/)
  bin\apache\<version>\       one Apache version per folder
  bin\php\<version>\          one PHP version per folder
  bin\database\<version>\     MariaDB or MySQL, with their databases in data\
  bin\vcruntime\              Visual C++ runtime used by the servers
  phpapps\                    phpMyAdmin and the UwAmp pages
  temp\                       PHP sessions, uploads, downloads

Your whole environment lives in this folder: copy it to back it up or move it to another PC, delete it to uninstall.

Versions and components

The Components page lists the versions available from the official sources: PHP (windows.php.net, current releases and archives), Apache (Apache Lounge), MariaDB and phpMyAdmin. Archives are downloaded over HTTPS, checked (SHA-256) and configured automatically.

Install as many versions as you need and pick the one to use in the lists of the dashboard: UwAmp restarts the server concerned. A MySQL version already present in bin\database works the same way.

  • PHP and Apache must have the same architecture (x64 with x64): UwAmp flags incompatible combinations.
  • With Apache, use the Thread Safe builds of PHP (NTS builds are flagged).
  • Each MariaDB / MySQL version has its own data folder: export your databases before switching to another major version.

Sites and virtual hosts

A subfolder of www is a site: www\blog answers on http://localhost/blog/. The dashboard lists your projects.

One-click new site

Apache page (or the New site button of the dashboard): enter a name, UwAmp creates www\<name> and a virtual host http://<name>.localhost/. Current browsers send every .localhost name to your PC: there is no need to edit the hosts file any more.

Virtual hosts

The editor of the Apache page sets, for each virtual host: address and port, ServerName and ServerAlias, DocumentRoot, aliases, <Directory> blocks (access, .htaccess) and extra directives. Save and apply checks the configuration and restarts Apache.

For a name that does not end with .localhost (for example mysite.test), add the line 127.0.0.1 mysite.test to C:\Windows\System32\drivers\etc\hosts (editor run as administrator).

Port 80 in use

If another program uses port 80, UwAmp shows its name. Close it, or change the main HTTP port in the Apache page (for example 8080): addresses become http://localhost:8080/.

Offline / online mode

The Network access switch of the dashboard chooses who can reach your servers.

ModeApacheMySQL / MariaDB
Offline (default)listens on 127.0.0.1, Require localbind-address = 127.0.0.1
Onlinelistens on every interface, Require all grantedbind-address = 0.0.0.0

Offline, your sites are only visible from your PC and Windows shows no firewall alert. Online, they can be reached from the local network with the IP shown on the dashboard (Windows then asks for the firewall permission). phpMyAdmin and the UwAmp pages stay reachable from your PC only.

In your own <Directory> blocks, write {ONLINE_MODE} to follow this setting.

Local HTTPS

On first start, UwAmp generates a self-signed certificate for localhost and enables a virtual host on port 443: https://localhost/ works right away. The browser warns that the certificate is not trusted: accept the exception for this site.

The Regenerate the SSL certificate button of the Apache page creates a new one. The certificate and its key are in bin\apache\<version>\conf\ssl\; they are unique to your PC.

MySQL / MariaDB

On first start, UwAmp creates the system databases with the user root and the password root. Connecting from PHP:

$db = new PDO('mysql:host=127.0.0.1;port=3306;dbname=test;charset=utf8mb4', 'root', 'root');

Changing the root password

Use the form of the MySQL / MariaDB page: UwAmp changes the password in the server and updates phpMyAdmin at the same time. If you changed it another way (phpMyAdmin, command line), enter the new password in Settings so that phpMyAdmin keeps connecting.

The same page changes the port, opens the MySQL console and the data folder. Servers are stopped cleanly, without any password.

PHP

  • Extensions: tick the ones to enable, each with a description. Missing DLLs are flagged.
  • Settings: display_errors, memory_limit, upload_max_filesize, post_max_size, max_execution_time, date.timezone, OPcache, Xdebug…
  • PHP console: a command prompt opened in www, with the active PHP version in the PATH.
  • Certificates: a root certificate bundle is given to curl and openssl, so outgoing HTTPS requests work without any setting.

Each PHP version has its own php_uwamp.ini, created from php.ini-development. You can rebuild it from php.ini-development or php.ini-production in the PHP page.

Configuration files

UwAmp generates httpd.conf, php.ini and my.ini from templates each time a server starts. Edit the templates, never the generated files:

ServerTemplate to edit
Apachebin\apache\<version>\conf\httpd_uwamp.conf
PHPbin\php\<version>\php_uwamp.ini
MySQL / MariaDBbin\database\<version>\my_uwamp.ini

The Edit buttons of each page open the template in your editor (chosen in Settings). When you save it, UwAmp restarts the server concerned. Before each start, the Apache configuration is tested (httpd -t) and any error is shown in the console.

Macros

In the templates, these words between braces are replaced by their value (paths use /):

MacroValue
{UWAMPPATH}UwAmp folder
{DOCUMENTPATH}www folder
{APACHEPATH}folder of the active Apache version
{PHPPATH}, {PHPEXTPATH}, {PHPZENDPATH}folder of the active PHP version, of its extensions, of its Zend extensions
{PHPAPACHE2FILE}, {PHPMODULENAME}DLL and name of the PHP module for Apache
{PHPAPPS}, {TEMPPATH}phpapps and temp folders
{CACERTPATH}root certificate bundle (curl, openssl)
{ONLINE_MODE}Require local offline, Require all granted online
{LISTEN_VIRTUAL_HOST_PORT}Listen lines built from the virtual host ports
{MYSQLPATH}, {MYSQLBINPATH}, {MYSQLDATAPATH}folder of the active MySQL / MariaDB version, of its programs, of its databases
{MYSQL_PORT}, {MYSQL_BIND}MySQL port, 127.0.0.1 or 0.0.0.0 depending on the mode

The Restore the initial configuration button of each page puts the original template back.

Updates

UwAmp checks for a new version at launch, then every 12 hours. The sidebar then shows Update available: the Update and restart button downloads the light version, checks its SHA-256 checksum, replaces UwAmp.exe and restarts UwAmp.

Only the program changes: servers, sites, databases and settings stay in place, and Apache and MySQL keep running. The check can be turned off in Settings.

Apache, PHP and MariaDB versions are updated separately, from the Components page.

Command line

Useful for a startup script or continuous integration:

UwAmp.exe --cli start               starts Apache and MySQL
UwAmp.exe --cli stop                stops the servers
UwAmp.exe --cli restart             restarts the servers
UwAmp.exe --cli status              shows the status
UwAmp.exe --cli install-defaults    installs Apache, PHP, MariaDB and phpMyAdmin
UwAmp.exe --cli install-defaults --php 8.4
UwAmp.exe --cli site myproject      creates www\myproject and http://myproject.localhost/
UwAmp.exe --cli check-update        looks for a new UwAmp version
UwAmp.exe --cli update              updates UwAmp

Add --root "D:\other\folder" to drive another UwAmp folder.

Troubleshooting

Apache or MySQL does not start

Read the console at the bottom of the window and the Logs page: the server output and their error.log are shown there. The Test the configuration button of the Apache page points to the faulty line of httpd_uwamp.conf.

Port already in use

UwAmp shows the program using the port (IIS, Skype, another WAMP server…). Stop it or change the port (Apache page for HTTP, MySQL page for MySQL).

Another Apache or MySQL is already running

UwAmp detects servers from other packages and stray my.ini or libmysql.dll files (in C:\Windows for example) that disturb MySQL, and reports them at startup.

Access denied, files not saved

Move the UwAmp folder out of C:\Program Files: Windows blocks writing there. If an antivirus blocks httpd.exe or mariadbd.exe, add an exception for the UwAmp folder.

Coming from UwAmp 3.x

UwAmp 4 opens a UwAmp 3.x folder as is: copy the new UwAmp.exe into your 3.x folder (keep the old one under another name if you want to go back) and run it. Your servers, sites, databases, uwamp.ini and *_uwamp templates are reused.

You can then install recent versions of PHP, Apache and MariaDB from the Components page. Old PHP 5.x builds compiled with Visual C++ 2008 or 2012 may still need the matching x86 Visual C++ Redistributable (links on the Download page, Previous versions section).

To start from scratch, unzip UwAmp 4 into a new folder, copy your www folder into it and export / import your databases with phpMyAdmin.