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:

  • Open a command prompt and enter CD c:\WinNMP\bin\MariaDB\bin

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

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

  • If you find a line like [ERROR] Table 'mysql.user' doesn't exist , in order to recreate the table, enter in the command prompt window:

    mysql_install_db -d c:\WinNMP\data 
  • If your access to the database is denied, kill mysqld and try to repair the privilege tables:

    mysqld.exe --defaults-file=c:\WinNMP\conf\mysql.ini --skip-grant-tables
    mysqlcheck.exe -u root --repair --force --silent --use-frm --databases mysql
    mysql_upgrade.exe -u root --force

If your access is still denied (root with no password), you could trigger the execution of the commands above plus root password reset by deleting the file c:\WinNMP\bin\mysql.bat and restartig WinNMP

  • After you manage to start MariaDB, you could check the integrity of your tables by running

    mysqlcheck.exe -u root --all-databases --auto-repair`
  • If there are still some InnoDB crashed tables, you could try to recover your data:

    Set temprarily innodb_force_recovery = 1 in conf\mysql.ini under [mysqld], start MariaDB, dump all data data with 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 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 to set / change / reset mysql(mariadb) root password on WinNMP:

Don`t do it! WinNMP needs to perform some maintainance tasks on MariaDB and it needs root access without password. This is no more of a security risk than having a password for WinNMP stored somewhere on the disk or registry.

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