Sample Header Ad - 728x90

Unable to run a .py file in cgi-bin by using ajax call from my .php file

1 vote
1 answer
541 views
Hi guys:) I am using a Beagle Bone Black with Debian Wheezy to make a project. I have a small problem:I have my index.php in /var/www from there I call a python file called send_email.php using ajax: `$.ajax({ url:"/cgi-bin/send_email.py" });` It works properly (it sends me an email and I receive it). But when I try to do the same thing with send_sms.py which has the following code inside `import nexmo client = nexmo.Client(key='XXXXX', secret='XXXXXXXXX') client.send_message({'from': 'Nexmo number', 'to': 'My own number', 'text': 'Hello World'})` When I run it from the terminal using: python send_sms.py, it works properly but when I call it using ajax it does not. I am confused as I thought that by calling any .py file in cgi-bin by using ajax, it would execute them (and it works for my send_email.py) but with send_sms.py it does not. Thank you for your help, it is appreciated!
Asked by Juan Jose Jaramillo (11 rep)
Apr 4, 2017, 10:04 PM
Last activity: Apr 11, 2017, 03:10 AM