WinNMP - Advanced usage and Debugging

What to do if a Local Virtual Server cannot be reached

After adding a new project with a local test domain name like myprojectname.test you should test in the browser if it is reachable by browsing to http://myprojectname.test. If it is unreachable you should try the following:

  • open Hosts File Editor, and manually add 127.0.0.1 myprojectname.test if missing
  • in a Command Prompt Window execute: ipconfig /flushdns
  • repoen your browser
  • your hosts file c:\Windows\System32\drivers\etc\hosts could be corrupted if you manually edited it and saved it with non-windows newlines \r\n

How to Debug Configuration Files:

After changing the configuration files, one server like nginx might refuse start. In order to find out the reason, you need to Check Configuration Syntax:

  • In the WinNMP Manager window, use the Check Configuration Syntax buttons to see the start up errors for Nginx and MySql
  • For PHP, if there are any startup errors, they will be shown as alert messages.
  • Also check the server logs in WinNMP\log
  • To see the commands used to start each service, Kill all servers and restart with WinNMP.exe --debug ( Display debug messages )
  • If nothing works, delete that configuration file, or from WinNMP\conf nginx.conf, mysql.ini, php.ini , kill all servers and restart WinNMP.exe. The Server Manager will copy the default configuration files to WinNMP\conf.

How to Clone/Sync WinNMP stack to a new machine:

You can safely move the WinNMP stack without loosing any data, projects, databases or settings. Run WinNMP installer once on the new machine, then overwrite/sync the whole WinNMP folder with the cloned one.

For example, syncing your work from C:\MyWork\WinNMP on Machine1 to D:\WinNMP on Machine2 should be done by running the installer once on Macine2 (and choosing D:\WinNMP as destination) then overwriting D:\WinNMP each time you need to sync your work.

If you move WinNMP stack to a new machine without running the installer, PHP 5.5 and later might refuse to start, because it requires Visual C++ Redistributable for Visual Studio 2012. You can install it manually from here. It will not run on windows XP.

If MariaDb Crashes after upgrade

If you upgrade WinNMP and you find that MariaDB dose not start, try the following:

  • Check if the configuration file syntax is correct by pressing the corresponding button in WTServer Manager

  • Check c:\WinNMP\log\mysql.log for any clues

  • If you find a line like [ERROR] Table 'mysql.user' doesn't exist , then run c:\WinNMP\bin\MySql\bin\mysql_install_db -d c:\WinNMP\data in order to recreate the table

  • After you manage to start MariaDB, you could check the integrity of your tables by running c:\WinNMP\bin\MySql\bin\mysqlcheck.exe -u root --all-databases --auto-repair

  • If there are still some InnoDB crashed tables, you could try to recover your data:

    Set temporarily `innodb_force_recovery = 1` in `conf\mysql.ini` under [mysqld], 
    start MariaDB, 
    dump all data data with `c:\WinNMP\bin\MySql\bin\mysqldump -u root  --opt --default-character-set=utf8 --triggers --routines --all-databases > c:\WinNMP\backup\dump.sql`, 
    stop MariaDB, 
    remove all data `del /f /s /q c:\WinNMP\data\*`, 
    execute `c:\WinNMP\bin\MySql\bin\mysql_install_db.exe  --datadir=c:\WinNMP\data` 
    then remove `innodb_force_recovery` from `conf\mysql.ini`, 
    start MariaDB, 
    then import your data back.
  • Or you could delete c:\WinNMP\data if you don't need to recover any data, and execute the latest installer

Also don't forget to backup your databases regulary..

How set / change / reset mysql(mariadb) root password:

When you log in to Adminer, you use mysql(mariadb) root account, which by default has no password

In order to set mysql(mariadb) root password, open a command prompt and type C:\WinNMP\bin\MySql\bin\mysqladmin -u root password NEWPASSWORD

In order to change mysql(mariadb) root password, open a command prompt and type C:\WinNMP\bin\MySql\bin\mysqladmin -u root -p'oldpassword' password NEWPASSWORD

If you forgot the mysql(mariadb) root password, you can reset all user accounts by running C:\WinNMP\bin\MySql\bin\mysql_install_db -d c:\WinNMP\data

How to Install Extras:

Let`s say you want to use Nginx 1.2.x instead of the currently installed version, or PHP 5.3.x