Reputation: 733
I'm working on a small site that runs via PHP a Python file.
The python file takes a few minutes to run and when finished send an email informing you that the process has finished running.
If I run the script manually from Terminal the email was sent. But when I try to run it from PHP using system()
function does not send the email.
I tested the issue by dumping and running the same line that system() would run via PHP, so no typos when running the test.
The python file tweets content from a CSV file with a random interval between a range of seconds and once all the tweets are sent it notifies via email to the user who run the script.
tweet.py {csv_file} {interval_min} {interval_max} {email_to_notify_when_finished}
python tweet.py test.csv 10 20 [email protected]
Other notes:
ec2-user
user, the same user that I used for manually testing this issue.ps -aux
shows me that the scripts are correctly run by ec2-user
.My specs:
Upvotes: 0
Views: 52
Reputation: 62
Can you try to narrow down what the python script is doing? You can try something as simple as print statements or write to file to confirm how much of your code is being run by the program when it is run by PhP.
Upvotes: 1