Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Gold Sponsor 2015!
Can I execute PHP with SSI include? or vice versa geogola
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.
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.
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.
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.