Python2.7 on cPanel Error message
I have followed the below link. It is working inside the cgi-bin folder, not in public_html.
Short Guide to Running Python Scripts with cPanel
Instead of getting error:
/usr/bin/python2.7: can't open file '\r' [Errno 2] No such file or directory: /home/username/public_html/2numbers.py
Can any one help me
-
No such file or directory: /home/username/public_html/2numbers.py
Hello, Could you let us know the entries you've added to the .htaccess file in the public_html directory, and verify that you copied the .py file to that location? Thank you.0 -
.htaccess file entries Options +ExecCGI AddHandler cgi-script .py File permission for 2numbers.py -> 0755 Website Link: domain.tld/2numbers.py I can't get this point Michael: verify that you copied the .py file to that location? 0 -
I can't get this point Michael: verify that you copied the .py file to that location?
For instance, did you copy the "2numbers.py" file from your cgi-bin to your public_html directory? Thank you.0 -
Both are different code Michael #!/usr/bin/python2.7 import time import datetime print("Current date and time: ", datetime.datetime.now()) print("Current year: ", datetime.date.today().strftime("%Y")) print("Month of year: ", datetime.date.today().strftime("%B")) print("Week number of the year: ", datetime.date.today().strftime("%W")) print("Weekday of the week: ", datetime.date.today().strftime("%w")) print("Day of year: ", datetime.date.today().strftime("%j")) print("Day of the month : ", datetime.date.today().strftime("%d")) print("Day of week: ", datetime.date.today().strftime("%A")) the above code is used on 2numbers.py code which is used on cgi-bin just a print statement. 0 -
Hello, Feel free to open a support ticket using the link in my signature so we can take a closer look. Thank you. 0
Please sign in to leave a comment.
Comments
5 comments