execute two shell commands in single exec php statement

后端 未结 5 920
走了就别回头了
走了就别回头了 2020-12-03 07:25

I want to display all the files that are modified after a specified date

the commands are

touch --date \'2011-09-19 /home/  , find /home/

5条回答
  •  伪装坚强ぢ
    2020-12-03 07:53

    Actually, my problem came from execution python file in a virtual environment of Python. Generally, Python website instructs us to go through command lines: create a virtual env --> activate it --> call Python file (e.g: python3 yourPyFile.py). However, when I was trying to adapt these steps through calling in php with exec() method, it didn't work. Finally, I found out you don't need to activate env at all, what you only need to use a python which already generated when you creating virtual env by path/to/virtual/env/bin/python3 yourPyFile.py.

提交回复
热议问题