Python Script Runs But Gives 500 Error

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
XDE4TH
A regular
A regular
Posts: 55
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Mon Oct 28, 2013 11:02 pm

Python Script Runs But Gives 500 Error

Post by XDE4TH »

I have a python script called map.py. It runs perfectly fine locally. I can Execute it in WinSCP with no errors and it does what it should. I can visit its URL and it will run and do what it should but the page displays a 500 error. I can also cURL to visit the page and it will run okay but also displays 500 error. I can NOT seem to get it to run with PHP exec or shell_exec commands.

The script and the page I'm trying to call the exec commands from both have full rights(0777). According to phpinfo and a test command, exec is enabled. This is what I see in access_log when visiting the page...
URL.com 98.xxx.xxx.164 - - [03/Dec/2015:08:36:44 -0800] "GET /path/to/script.py HTTP/1.1" 500 379 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"

And even though it says 500, the script did what it was supposed to do. I just don't understand why this 500 error is showing up?

Any ideas.

Python Script: http://pastebin.com/P0xn9euH
Example Excel Sheet: https://mega.nz/#!9UYVmRiI!DLHrTktB5aXC ... LVPreibhsI
XDE4TH
A regular
A regular
Posts: 55
Joined: Mon Oct 28, 2013 11:02 pm

Re: Python Script Runs But Gives 500 Error

Post by XDE4TH »

Since I can't just update my original post....I managed to solve this problem now and its working properly with phps exec function. I swear I tried this before and it didn't but it seems to be working now. I'm not sure if I changed something else that is now making it work or what. I have removed the above links as well.
Post Reply