Page not found in cgi-bin directory

I'm not that familiar with apache web server environments, so am at a loss here - I have placed a file called test.php in the site's cgi-bin directory, but when I try to access the page I get a page not found.

http://www.mydomain.com/cgi-bin/test.php

Is this because you can't directly access pages in a cgi-bin directory on Apache? Even if you explicitly point to the page?
LVL 1
rascalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
how is your server configured?
0
Artysystem administratorCommented:
> Is this because you can't directly access pages in a cgi-bin directory on Apache?

In shared web hosting /cgi-bin often an alias to some common external directory, not available for you. So your internal /cgi-bin could never be accessed via http://mysite.com/cgi-bin but that common /cgi-bin is accessed this way.


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rascalAuthor Commented:
ozo: I can put phpinfo.php on the site and run that to get various details of the web host (it's not my own web server, it's a shared server plan).

Nopius: I understood the first part of your message about how cgi-bin can be an alias so I could never access that page, but the second part of your note lost me. If my FTP can post the file test.php to that cgi-bin directory, shouldn't I be able to run it from the http line in my browser?
0
Artysystem administratorCommented:
> If my FTP can post the file test.php to that cgi-bin directory, shouldn't I be able to run it from the http line in my browser?

In case of server-wide aliased /cgi-bin you can see your folder by FTP, but not via HTTP. There is no way to redefine server-wide alias in .htaccess file (but this can be done for your virtual host in server config file)

You may change directory name to something different, say /cgi and configure your /cgi/.htaccess to allow CGI execution there. It can be done with 'Option +ExecCGI' and 'SetHandler cgi-script'.
Of course you should change all HTML pages that refer to /cgi-bin to point to /cgi

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.