PDA

View Full Version : SSI with PHP files



Saotome007
04-25-2008, 12:25 PM
I have searched the forums, FAQ's and tried most everything i could find to resolve our current issue. We are creating a website to go along with our forums. The entire site is coded in PHP.

I am trying to get access to the SSI via <?php include("blahdir/SSI.php"); ?> and am being returned the following error upon trying to open the page:

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

Please contact the server administrator, webmaster@ifguild.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8g DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at ifguild.org Port 80

if i try to add "server-parsed" to .php then if you try to open any php page via ie, it tries to download the page to your pc, rather than parsing and posting the page

I reverted everything back to defaults, and attempted to open the ssi_examples.php which come along with the forums module and are returned the exact same error.

Is there something i am missing?

Thanks!

greenman
04-27-2008, 09:29 PM
Here's a whole page in a nutshell using php includes:
<?php $myRoot = $_SERVER["DOCUMENT_ROOT"]; ?>
<?php include($myRoot.'/assets/header.php'); ?>
My page specific goes content here.
<?php include($myRoot.'/assets/sidebar.php'); ?>
<?php include($myRoot.'/assets/footer.php'); ?>Here, we've provided the full path so there is no question where the documents are to the server, hence no 500, no 404. If you're whole site is templated this way, you'll be able to drag and drop the whole site in all it's glorious folders from one host to another with a minumum of effort.

If you're using Dreamweaver, it's going to look ugly in WYSIWYG, but you get used to it.

If you expect this to work at domain2.com and domain1.com/domain2, don't. It's better to choose one or the other. But that's another story. :)