Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Php script in CGI Bin 2

Status
Not open for further replies.

tyhand

Programmer
Joined
Jul 3, 2002
Messages
186
Location
US
Hey all,

I'm working on a script but for some reason it doesn't work when I place it in the CGI Bin. I've made sure that all the permissions are set correctly. It works fine in my main *public_html* folder. I keep getting an http 500 Server Error. Any ideas?

Thanks. Peace!

BTW, I'm using PHP 4 on a Unix/Apache server

T Y H A N D
 
check your php configuration under the working directory parameter and make sure it's pointed to the dir you want.
 
Questions:
Are we talking Apache 1.3 or 2?
PHP 4.?
Have you changed the httpd.conf to allow PHP execution in /cgibin/
Have you restarted the Apache server after changes?
 
hey all,

thanks for the replies.

I'm running PHP Version 4.3.2 and Apache 1.3.27

However, I think the problem is with my web host provider.
I think they just don't allow it. Don't know why.

Thanks again.

T Y H A N D
 
Oh, so, I understand.
Your Web host is running PHP 4.3.2 on Apache 1.3.27
I wrongly assumed you have your own installation of PHP and server.
I have a /phpbin/ area that is like /cgibin/, just as a clarifying structural element. However, the code there is just PHP, no mixture of HTML and PHP.
 
One thing that can affect the performance of PHP scripts when running PHP as a CGI language rather than as a module is HTTP headers.

When PHP runs as an Apache module, you don't need to worry about, for example, the "Content-type" header unless that header must be something other than "text/html", because Apache will supply that header.

When you're running PHP as a CGI, your scripts must supply that header. And if your script does not, Apache will generate the "500" error you've described.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top