Changes Not Taking Effect After Modifying Code
Reason:
Workerman runs in memory, which helps avoid repeated disk reads and repeated interpretation and compilation of PHP, achieving the highest performance. Therefore, after changing business code, it is necessary to manually reload or restart for the changes to take effect.
At the same time, Workerman provides a file monitoring service that automatically runs a reload when it detects any file updates, reloading the PHP files. Developers can include this service in their project to start it along with the project.
Note: The reload feature is not supported on Windows systems, and the monitoring service cannot be used.
File Monitoring Service Download Links:
-
No dependency version: https://github.com/walkor/workerman-filemonitor
-
Dependency on inotify version: https://github.com/walkor/workerman-filemonitor-inotify
Differences Between the Two Versions:
The version in link 1 uses a method that polls file update times every second to determine if the file has been updated,
The version in link 2 utilizes the Linux kernel inotify mechanism, where the system actively notifies Workerman when a file is updated.
Generally, the no dependency version in link 1 is sufficient.