Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Can I execute PHP with SSI include? or vice versa geogola msg:1285490 10:48 pm on Jan 9, 2003 (gmt 0) 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.
jatar_k msg:1285491 11:14 pm on Jan 9, 2003 (gmt 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.
andreasfriedrich msg:1285492 11:20 pm on Jan 9, 2003 (gmt 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.
andreasfriedrich msg:1285493 11:24 pm on Jan 9, 2003 (gmt 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.