Forum Moderators: coopster

Message Too Old, No Replies

include php file in php file and shtml file.

         

dkin

7:03 pm on Nov 20, 2004 (gmt 0)

10+ Year Member



I am having a slight problem, my ssi was working fine in all of my shtml pages but I needed to make a few php pages. Now the include of counter.php works on the php files and not on the shtml files.

This is my shtml include

<!--#include file="counter.php" -->

This is my php include

include("counter.php");

And this is my error

[Sat Nov 20 13:59:51 2004] [error] [client 206.172.171.169] unable to include potential exec "counter.php" in parsed file /yorkshire_terriers.shtml

Thank you

Span

7:23 pm on Nov 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



shtml parsing php
[webmasterworld.com ]

dkin

7:37 pm on Nov 21, 2004 (gmt 0)

10+ Year Member



Im not sure if we are on the same page because I do not understyand why HTACCESS would come into play.

I have a php include on a php page and an ssi include on an shtml page.

For some reason it does not work on the shtml page but it works on the php page.

if you visit this page you will see what I mean

click around the menu and you will see the include not working on the left side underneath the menu.

Thank you

[edited by: jatar_k at 10:47 pm (utc) on Nov. 21, 2004]
[edit reason] removed link [/edit]

coopster

3:09 pm on Nov 22, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you tried virtual [httpd.apache.org] instead of file?
<!--#include virtual="counter.php" -->

dkin

6:11 am on Nov 23, 2004 (gmt 0)

10+ Year Member



That did not work either, should I just change all the extensions and includes to php?

jatar_k

11:56 pm on Nov 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



would probably be easier, you can't include it because you are already parsing for SSI and then jamming php in there. They never like to play nicely, the 2 parsers in the same file.

coopster

12:02 pm on Nov 24, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Actually, with the correct server configuration, you can do both but as jatar says, why would you? Since PHP can do everything that SSI can do, including exec some other programs, you may choose to use PHP instead of SSI. However, dkin, you've already stated your case so I believe you are going to need to check your server configuration...

That error message is issued when you are using the Apache IncludesNOEXEC [httpd.apache.org] directive, which means that you are not allowing SSI exec to run programs [httpd.apache.org].

Additional Resources:
Search these pages for "IncludesNOEXEC"
mod_include (Basic Elements -- The exec Element and The include Element) [httpd.apache.org]
Apache Core -- Options Directive [httpd.apache.org]