There are two good options here:
PHP
PHP is a server side language, and if you design the frontend with some robust classes, you can reuse the classes for the command-line daemon. This allows you to have a more standardized application suite, which will be easier to modify in the future. PHP can access MySQL, and since you already know it, the learning curve will be minimal.
Python
Python is an excellent server side language for an application like this. It can talk to any SQL database with a standardized instruction set, called DB API 2.0. This means taht if at any point you want to change from MySQL to PostgresSQL, you simple change:
import my_mysql_library as sql
to:
import my_postgres_library as sql
And your application won't need any other code changes. Python also contains many libraries that might come in handy, and if optimized correctly, will be faster than PHP.
Conclusion
Personally, I would use Python, for the following reasons:
- Learning Experience; Programming is always about learning. At any opportunity, use a language or tool you don't already know so that you can learn it.
- Language Preference; After programming in both PHP and Python, I can honestly say that there is no situation where I would prefer to use PHP over Python. Not one.
- Available Libraries; Python has a very robust community, and a lot of useful libraries and packages (such as NumPy) that make things much easier for you.
With both languages you could have them run intermittently via a cron job, or you could have them run as a Daemon (which is as easy as running the script(s) while piping your output to a black hole, such as /dev/null)