kalaba2003
kalaba2003

Reputation: 1229

Why can't my .php extension files work in as CGI in cgi-bin folder(linux server)?

I recently purchased domain name and hosting from "www.domain.com". My hosting is "Linux Hosting". I prepared a web site with PHP. While I was looking hosting features, there was PHP5 support. After that, in web site configuration, I noticed that PHP5 support is only avaible as a cgi application. Up till now, I didn't know what cgi is. I researched a bit. I noticed that there is a directory called cgi-bin. I put my php files in it but gave internal server error. But in cgi-bin directory, .cgi extensions work. when I looked from Internet, I understood that there must add some handler into .htaccess or into httpd.conf. I am not authoritized to access these files but I can add some handler from "web site configuration" in my hosting.

Iknow I am doing something wrong but I don't know what it is. Thanks...

Upvotes: 2

Views: 2251

Answers (2)

noli
noli

Reputation: 3745

Search the hosting documation. I bet you will need to add #!/path/to/php at the first line of your scripts.

Upvotes: 0

iBiryukov
iBiryukov

Reputation: 1740

CGI means that PHP is configured to run as a separate process from your web server (apache usually), as opposed to the module of the web server.

You should be able to simply place the php file at your web root (usually in /var/www), navigate to the file in your browser, and it should all work.

Also, make sure you check your apache logs, in /var/log/

Upvotes: 1

Related Questions