Add the following lines on top of your script (above the <html> tag)

<?PHP
ini_set("display_startup_errors","On");
ini_set("display_errors","On");
?>

These settings are set to off on your server so I hope that setting these values to On will prevent the premature end errors and display something useful instead.

Thomas

    made changes
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    i'm going to the /var/log/httpd/error-log file and it's not been updated since 10:51 today... odd that it's almost 1400 now

      Do you have a shared server or a managed/dedicated server with shell access ?

        shared server i can't get a shell on it.

          Ok,

          does the following scripts work ?

          <?PHP
          ini_set("display_startup_errors","On");
          ini_set("display_errors","On"); 
          
          $fp = fopen("mytestfile.txt","w");
          
          if ($fp !== false) {
            fwrite($fp, "test");
            fclose($fp);
          } else {
            echo "couldn't create test file";
          }
          ?>
          

            correction when i do a chmod 666 it generates a whitepage and a file with test in it, when i do it at chmod 777 it generates a server error

              Ok,

              I think that this could be a suexec problem. suexec can be very paranoic and having file permissions set to 777 means to open the given file for everyone. So suexec will block the access to that file and further execution of PHP. The behaviour of php depending on file permissions is a hint that there's suexec enabled apache running.

              So don't use the 777 permission (I think suexec blocks PHP if the given file is world executable which might be a security risk).

              Please check if there's a suexec log on the server.

              Thomas

                Create a script that just contains

                <?PHP
                echo "a";
                ?>
                

                and change permissions of that script to 777. If you get a cgi error then suexec is most likely active.

                Thomas

                  tsinka wrote:

                  Create a script that just contains

                  <?PHP
                  echo "a";
                  ?>
                  

                  and change permissions of that script to 777. If you get a cgi error then suexec is most likely active.

                  Thomas

                  trying now

                  Update - > interneal server error, i'm looking for the log

                    the only logs i have access to are
                    access-log
                    error-log
                    and xfer-log

                      suexec, is there any way to see if it's configured

                        Interesting question, I don't know. The phpinfo output doesn't show anything about suexec.
                        I think this is the way to solve the problem:
                        Execute the script that creates the test file but don't create the test file before executing the script so that the script creates the file itself (delete the file if it already exists). Then check which permissions the file has and use those permissions.

                        Thomas

                          Interesting, PHP creates the files with permissions that prevent the further use of the files. Modify the script so that it changes permissions to 666 after writing to the file and then try to write to the file again and look how permissions change (if they change at all after writing the second time).

                            i apologize for my sudden exit from this thread, but i had some issues I had to attend to, I've returned and am ready to continue anew.

                            test.php
                            <?PHP
                            ini_set("display_startup_errors","On");
                            ini_set("display_errors","On");
                            
                            $fp = fopen("mytestfile.txt","w");
                            chmod("mytestfile.txt", 0666);
                            
                            if ($fp !== false) {
                              fwrite($fp, "test");
                              fclose($fp);
                            } else {
                              echo "couldn't create test file";
                            }
                            ?> 
                            

                              ok now, it's at least trying to do the script. i'm going to try a few more things here see what happens. basically combine all the different scripts into one... see what happens.

                              essentially it's skipping all the php scripts that are on the page and only printing out the html to the the page, it's supposed to create two files and it's not doing that either.