Okay, so that can mean anything! Can anybody help a floundering newbie. I am following directions in SAMS Teach Yourself MySQL in 24 Hours. Meloni (2002) writes:

"An easy way to tell if PHP and MySQL are installed and ready for use is to open a text file and put the following line in it and nothing else:

<? phpinfo() ?>" (p. 271)

This test (test.php) results in an internal error message and the Apache error log indicates "Premature end of script headers." 😕

AMP (Apache / MySQL / PHP) installed by means of PHP Triad on a Windows 98 machine.

Thanks in advance for consideration of my question.

Best regards,

jcwinnie

    <?php
    phpinfo();
    ?>
    

    That and nothing else should work. If not, let me know.

      Nope. I get "Internal Server Error" message.

        Hrm. Okay, which version of php? Which version of apache? Is there a space or carriage return before the <?php in your file?

          I installed AMP from Triad 2.2. I am assuming I have PHP4 and Apache 1.3.

          I copied the code from previous message. It appears to be a carriage return.

            I ran a test with a different server (OmniHTTPd Professional). I get a CGI Launch Error when I try to open test.php

            I also should mention that PHP is installed as CGI. I have yet to try the SAPI approach.

            Feel like I'm hitting my head against a brick wall trying to get PHP to run on Windows 98.
            🙁

              When you used Apache, was php installed as a cgi or a module? It sounds like a cgi. I don't know why it took me so long to realize that. 🙁 Module is best but if you want to use the cgi, you need to put a shebang line at the top of all of your scripts.

              #!C:\path\to\php

              Don't put .exe at the end of php.

                I used the PHP Triad Console to install Apache as a service; the test still failed.

                I copied the shebang line into test.php; the test failed.

                  Hrm . . . What did you do? Here is a full php-cgi script:

                  #!C:\path\to\php
                  <?php
                  print("Hello people.");
                  ?>
                  

                    #!C:\path to php
                    <?php
                    phpinfo();
                    ?>

                      Hrm . . . This is one of those times when I wish I had access . . . Ah well. So, mod_php is not installed?

                        There is no mod_php statement in httpd.conf

                          Let me know if mod_php gives you the same trouble.

                            Write a Reply...