mysql - Can I run php script in background mode? -
now, developing snmp webserver , want data mib in windows insert in mysql data base. use snmp connection provide in php, want php script run , no interface in background updating database. can or there better way do. please, me.
you'll need daemon in php, although isn't best way it, it's possible. fire php script command line (php cli environment) , fork off console new process. starting depends on os, in either case simple console script job. have make sure php script never finishes. use never ending script poll snmp agent , write values mysql. design bunch of php scripts reading db , displaying values in webpage.
note: php not designed such purpose, i.e. implementing resident daemon behaves kind of application, may run difficulties regarding memory consumption , processing (no multi-threading!).
i recommend use language daemon service i.e. java. there's free open source library snmp4j easy use , let realize poller in minutes (i it's more mature snmp extension in php).
Comments
Post a Comment