SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about scripting for php as a CGI

    I am writing a script that I am trying to run on a server that has php set up as a cgi binary. The beginning of my script looks as follows:

    #!/usr/local/bin/php
    <?php
    include("functions.php");

    mysql_connect($db_Hostname, $db_UserName, $db_Password) || die("Can't Connect to Database: ".mysql_error());
    mysql_select_db($db_Database);

    It is chmoded 755 and the path to php is correct in that first line, but I get 500 errors when executing the file. Any ideas as to why this is not working?

    And if it were working, would that path to php statement create problems for header and setcookie functions?
    Marty H.

  2. #2
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I read this once at vb.com I think - try stringing the #! line and <? together, like so:

    #!/usr/local/bin/php<?php

    HTH
    Kevin


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •