logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Can't get a PHP file to include via SSI
Author
a101computers



Joined: 17 Mar 2007
Posts: 3

PostPosted: Sun 18 Mar '07 23:51    Post subject: Can't get a PHP file to include via SSI Reply with quote

I'm not having any luck using this code in an .shtml file. The php file doesn't load and doesn't give me an error.

It worked okay before I moved to Apache 2.2.4 (using Wamp)

<!--#include virtual="/includes/filename.php?siteid=123456" -->

Can anybody tell me what I need to tweak in my conf file to get it to work?

My regular .shtml include on the same page (shown below) works fine
<!--#include virtual="/includes/filename.shtml" -->

My PHP is working fine, as evidenced by the fact that a PHP bulletin board is working fine, but I just can't get that one call above to work.

My httpd conf file contains the following lines: (Am I doing it wrong?)

AddType application/x-httpd-php .php .html .shtml
AddType application/x-httpd-php .php3
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml .php

Thanks in advance
B
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7306
Location: Germany, Next to Hamburg

PostPosted: Mon 19 Mar '07 10:45    Post subject: Reply with quote

Hello,
you can not run 2 intepreters on one file extension.
Back to top
a101computers



Joined: 17 Mar 2007
Posts: 3

PostPosted: Mon 19 Mar '07 19:51    Post subject: Reply with quote

Hi James -
Thanks much for the help!

Could ya tell me which part of the code I need to separate?

Forgive my ignorance!

Thanks man!
Brian
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7306
Location: Germany, Next to Hamburg

PostPosted: Mon 19 Mar '07 21:36    Post subject: Reply with quote

change

from
AddOutputFilter INCLUDES .shtml .php

to

AddOutputFilter INCLUDES .shtml
Back to top
a101computers



Joined: 17 Mar 2007
Posts: 3

PostPosted: Tue 20 Mar '07 1:20    Post subject: Reply with quote

So I removed the .php from
AddOutputFilter INCLUDES .shtml .php

so now it's just
AddOutputFilter INCLUDES .shtml

And I restarted the server.

But still, the call
<!--#include virtual="/includes/filename.php?siteid=123456" -->
is not working

Any ideas? THanks in advance!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7306
Location: Germany, Next to Hamburg

PostPosted: Tue 20 Mar '07 10:31    Post subject: Reply with quote

Are the following modules loaded in httpd.conf?

* mod_include
* mod_cgi
* mod_expires

Do you have enabled ssi in your doc root?

Options +Includes

So you have ?

AddType text/html .shtml


Please consult the apache docs!

http://httpd.apache.org/docs/2.2/howto/ssi.html


Include php in a ssi page?

Why don't you use php only for that?

Like

Code:

<?php
include "/includes/filename.php?siteid=123456";
?>
Back to top


Reply to topic   Topic: Can't get a PHP file to include via SSI View previous topic :: View next topic
Post new topic   Forum Index -> Other Software