PHP runing as CGI requires shebang?

Hi, i’m new to dreamhost service, I just bought a Dedicated server service. I have few questions that anyone might know the answers to.

  1. Running PHP as CGI and enabling Fast CGI, does php files need certain permission or perhaps a shebang like “#!/usr/bin/php” on top of each PHP page? My site is and it seems that everytime I enable the PHP as CGI, it isn’t executing the PHP files.

  2. Enabling Fast CGI, would it slow down my site if it’s enabled? What’s the down side to this? Does it create more load to the server?

Well that seems to be the only problem at the moment, the Site’s just running the PHP without PHP as CGI. and If by using PHP as CGI helps, i’d like to make it work.

Other than that it’s a very reliable service! And best part is their office is located near me :slight_smile:


The shebang line should not be necessary for running PHP as CGI, no. Note that when running it as CGI it will run as your server user rather than the apache user (dhapache) so file permissions need to be set differently. On a dedicated server with only one or two users that’s not as important as on shared servers.

Turning on FastCGI will not enable it for your PHP automatically. You would have to set up your PHP code to support it. By default our system sets it up for files ending in .fcgi. You can use a .htaccess to enable it for .php if you want. Remember that the PHP code needs to explicitly support it, though.

  • Dallas
  • DreamHost Head Honcho/Founder

Cool, thanks for the info! :slight_smile: