A portable, preconfigured, lightweight, fast and stable server stack for developing php mysql applications on windows, based on the excellent webserver Nginx. A lighter alternative to XAMPP and WAMP.
HostsEditor.exe
. This is required to map the domain name myProjectName.test
to localhost
, for testing SEF links and other Nginx rewrite rules.Live Url
if any. This should point to the production version of your project, hosted on a remote server.Save
to close the Edit Project windowView Local Virtual Server
to see the default New WinNMP Project page.c:\pathTo\WWW\myProjectName
folder.HeidiSql
or Adminer to create the project's databaselocalhost
with username root
and no password.localhost
port 6379Upload or Sync the project files to the remote server, as explained below.
Return to the project list and click on Synchronize
or Browse
icons. A WinSCP dialog will open.
Composer is a tool for dependency management in PHP used to download and keep updated various PHP frameworks and components. After you created a new project in c:\pathTo\WWW\myProjectName
, click on Open Command Prompt
icon, then run commands like:
composer create-project silverstripe/installer myProjectName 3.1.*
composer create-project laravel/laravel myProjectName --prefer-dist
cd myProjectName
composer require components/jquery
composer require components/bootstrap-datetimepicker
cd myProjectName
composer create-project symfony/framework-standard-edition c:\pathTo\WWW\myProjectName 2.4.*
Your project's Nginx settings are stored in conf\domains.d\myProjectName.conf
. This file`s root directive is automatically modified by the WinNMP manager for portability.
If you want to use a custom root folder for your project, for example WWW\myProjectName\public
, you can manually set this root directive and lock it using the comment # locked
root "C:\PathTo\WWW\myProjectName\public"; # locked
WinNMP has 2 options for processing emails sent by PHP's mail() function: mSmtp and mailToDisk (default). To change the option, edit conf\php.ini
and modify sendmail_path
:
For Development use mailToDisk (the default):
sendmail_path = '"C:/WinNMP/bin/php" -n -f "C:/WinNMP/include/tools/mailtodisk.php" --'
Emails will be saved to log\mail-XX.eml
For Production use mSmtp:
sendmail_path = '"C:/WinNMP/bin/msmtp/msmtp.exe" -C "C:/WinNMP/conf/msmtp.ini" -t'
You also need to edit conf\msmtp.ini
in order to configure SMTP server options
In the Projects list, click , check
Enable Local Virtual Server
, then Save.
Edit WinNMP\conf\domains.d\projectName.conf
directly or click on Edit Nginx Virtual Server
button in the Edit Project window
Modify like this:
server {
listen 127.0.0.1:80;
listen *:80;
server_name projectName.test projectName.com projectName.myDomain.com;
### Access Restrictions
allow all;
## deny all;
Now Kill
Nginx, Start
Nginx OR Check Nginx Configuration Syntax
.
You can always use different/multiple server names for your Local Virtual Server
. Use Hosts File Editor (the third icon) to add extra local server names like:
127.0.0.1 projectName.dev
127.0.0.1 projectName.test
127.0.0.1 www.projectName.xyz
Then Edit conf\domains.d\projectName.conf
and add
server_name projectName.dev projectName.test www.projectName.xyz;
If you want a location like /phpMyAdmin
to serve files from a directory outside your project (but inside PHP's open_basedir
), for example C:/WinNMP/include/phpMyAdmin
you need to edit the Nginx config file:
Edit WinNMP\conf\domains.d\projectName.conf
to set http://projectName.local/phpMyAdmin
Edit WinNMP\conf\nginx.conf
to set http://localhost/phpMyAdmin
server {
....
location ~ ^/phpMyAdmin/.*\.php$ {
root "C:/WinNMP/include";
try_files $uri =404;
include nginx.fastcgi.conf;
fastcgi_pass php_farm;
allow 127.0.0.1;
allow ::1;
deny all;
}
location ~ ^/phpMyAdmin/ {
root "C:/WinNMP/include";
}
}
Notice that the root directive lacks /phpMyAdmin
because Nginx adds the URL path /phpMyAdmin
to the root path, so the resulting directory is C:/WinNMP/include/phpMyAdmin