Sometimes OK, but ...
Sometimes this is the best way to solve a problem.
But the following problems are possible:
Security
Watch out for code injection if you are not performing a taint check .
Performance
Running shell commands will include a forking PHP interpreter and making complex and relatively slow system calls . This is normal for a lightly loaded server, but will not work for a busy site.
Synchronization
Ensuring that everything happens in the correct order avoids known issues called lost updates, dirty reads, and incorrect summaries. Although shell commands alone are not the cause of any of these things, running them asynchronously and increasing the complexity of your system will make analysis difficult.
source share