Welcome to WebmasterWorld Guest from 23.22.140.143

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Can I execute PHP with SSI include? or vice versa

     

geogola

10:48 pm on Jan 9, 2003 (gmt 0)

Inactive Member
Account Expired

 
 


i'd like to SSI include a .php file so it would actually run the code or if that's not possible in any way then can i php include a CGI file so it would execute.

thanks, gola

11:14 pm on Jan 9, 2003 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


Welcome to WebmasterWorld geogola,

I don't think including a php file with SSI will work. If you have SSI enabled for a file extension then, I don't think, adding php parsed as well will work.

I would use the php extension on that particular page and then include the file using the php include or require function.

11:20 pm on Jan 9, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 22, 2002
posts:1782
votes: 0


Let me welcome you to WebmasterWorld [webmasterworld.com] as well geogola.

Be sure to read Marcia`s WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com] post.

On Apache you may include the results of a CGI script with PHP´s virtual [php.net] function which performs a subrequest. This is similar to <!--#include virtual --> in SSI.

Andreas

11:24 pm on Jan 9, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 22, 2002
posts:1782
votes: 0


SSI includ[ing] a .php file so it would actually run the code is possible as well but not advisable. You could just use <!--#include virtual --> and have the PHP CGI binary execute and run the PHP code. But why would you want to do that when there is the PHP Apache module available which save the server from having to start a new process, etc.

Andreas