Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8234795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:36:08+00:00 2026-06-07T18:36:08+00:00

I have a file test.py in my cgi-bin folder for apache. The file looks

  • 0

I have a file test.py in my cgi-bin folder for apache.
The file looks like this:

#!/usr/bin/python
print("Content-type: text/html\n\n")
print("Hello world!")

Then, if I go to www.<mywebsite>.com/cgi-bin/test.py, the page successfully shows Hello world!

But, if I change my header line in my python script to

#!/home/kalaracey/python2.7/bin/python

when I navigate to www.<mywebsite>.com/cgi-bin/test.py, I get a Error 500 Internal Server error. Any ideas?

I have done sudo chmod 755 test.py and can call it with just ./test.py with both versions of the header line.

EDIT: Per @Anony-Mousse ‘s comment, here’s the Apache error_log that applies:

[Wed Jul 11 17:33:40 2012] [error] [client <ipaddress>] (13)Permission denied: exec of '/var/www/cgi-bin/test.py' failed
[Wed Jul 11 17:33:40 2012] [error] [client <ipaddress>] Premature end of script headers: test.py
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:36:10+00:00Added an answer on June 7, 2026 at 6:36 pm

    Does the web server user have access rights to your custom python installation?

    If it cannot execute /home/kalaracey/python2.7/bin/python it cannot execute your script.

    Make you have chmod -R go+rX /home/kalaracey/python2.7 and chmod go+x /home/kalaracey/python2.7/bin/python.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this test python file import os print 'Content-type: text/html' print print '<HTML><HEAD><TITLE>Python
I have a test file that has many lines, each line looks something like:
I have a file called 'removethese' who's contents looks like this: ./test_dir/file1 ./test_dir/file2 ./test_dir/file
I have one file (for example: test.txt), this file contains some lines and for
I have these (sample) lines in a HTML-file: test.ABC.test test.ABCD.test test.ABCE.test And this Ant
I have a file watch directory named FileWatch C:\Users\MyFolder\FileWatch\Test The FileWatch folder is the
I have one file called test.ai and I need to print it several times,
Say I have file test.txt with content: Lorem ipsum dolor sit amet, consectetur adipiscing
I have text file(test.data), which include(this is just example other files have more values....)
I have a simple HTML Form <form id=uploadForm method=post action=/cgi-bin/test.cgi enctype=multipart/form-data> <input type=submit name=add_something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.