WinNMP - Advanced usage and Debugging
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.testif missing
- apply changes in Hosts File Editor: CLICK SAVE - (CTRL-S) and File>Exit (ALT-F4)
- close your browser and repoen it
- your hosts file
c:\Windows\System32\drivers\etc\hostscould be corrupted if you manually edited it and saved it with non-windows newlines
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 Reload Nginx if Configuration Syntax is ok or Restart MariaDb if Configuration Syntax is ok 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
- To see the commands used to start each service, look in
- 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.
If Nginx respondes with 502 Bad Gateway and you notice a lot of Detected CRASHED process 900x in
log\winnmp.log it means that PHP-CGI stops or crashes and WinNMP will try to restart it.
Usually the reason is conflicting php extensions or a stack overflow generated by your php code.
The real reason is very hard to find, as php-cgi will not output anything to STDERR or
Starting WinNMP with
winnmp.exe --debug will enable capturing STDOUT and STDERR in
log\php_cgi_900x.txt but usually php crashes before writing to this files, and they will remain empty.
You could also start php-cgi in visible windows by pressing Kill php in WinNMP and then running
You could try disabling some or all php extensions in
conf\php.ini or you could remove everything from php.ini except for the first few lines, in order to start with default values. Then you need to restart PHP.
conf\php.ini and restart WinNMP in order to revert to the basic php.ini settings.
WinNMP is portable. You can safely copy or move the WinNMP stack without loosing any data, projects, databases or settings. You can even copy and run it from a flash drive.
If you move WinNMP stack to a new machine without running the installer, PHP or WinNMP Manager might refuse to start, because they require Visual C++ Redistributable for Visual Studio. You should install it manually.
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 upgrade WinNMP and you find that MariaDB dose not start, try the following:
Open a command prompt and enter
Check if the configuration file syntax is correct by pressing the corresponding button in WinNMP Manager
c:\WinNMP\log\mysql.logfor 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:
innodb_force_recovery = 1in
conf\mysql.iniunder [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\datathen remove
conf\mysql.ini, start MariaDB, then import your data back.
Or you could delete
c:\WinNMP\dataif you don't need to recover any data, and execute the latest installer
Also, don't forget to backup your databases regulary..
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.
Let`s say you want to use Nginx 1.2.x instead of the currently installed version, or PHP 5.3.x