| Author |  | 
| a101computers 
 
 
 Joined: 17 Mar 2007
 Posts: 3
 
 
 | 
|  Posted: Sun 18 Mar '07 23:51    Post subject: Can't get a PHP file to include via SSI |   |  
| 
 |  
| 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: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Mon 19 Mar '07 10:45    Post subject: |   |  
| 
 |  
| Hello, you can not run 2 intepreters on one file extension.
 |  | 
| Back to top |  | 
| a101computers 
 
 
 Joined: 17 Mar 2007
 Posts: 3
 
 
 | 
|  Posted: Mon 19 Mar '07 19:51    Post subject: |   |  
| 
 |  
| 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: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Mon 19 Mar '07 21:36    Post subject: |   |  
| 
 |  
| change 
 from
 AddOutputFilter INCLUDES .shtml .php
 
 to
 
 AddOutputFilter INCLUDES .shtml
 |  | 
| Back to top |  | 
| a101computers 
 
 
 Joined: 17 Mar 2007
 Posts: 3
 
 
 | 
|  Posted: Tue 20 Mar '07 1:20    Post subject: |   |  
| 
 |  
| 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: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Tue 20 Mar '07 10:31    Post subject: |   |  
| 
 |  
| 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 |  |