• Here’s the deal, I’m using Exec-PHP to be able to run php in some posts. So far, I haven’t put too much code in, but it seems to be working fine. Then in one of my scripts I try to use an include, here is the code:
    include 'http://www.mysite.com/path/to/file.php';

    Anyway, then I get this error:

    Warning: Unknown(): stream does not support seeking in /usr/local/psa/home/vhosts/mydomain.com/wp-content/plugins/exec-php.php(39) : eval()’d code on line 2

    So you’ve seen the code on line 2. What could be the problem?

    I would like to use a relative path to include that file, but I don’t know how to use a relative path in my post. How do I do that?
    thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You are receiving a Warning not an error so the code should still work it just is letting you know there could be issues. The Warning is to let you know that you are not going to get what you think. You will get the server output of the file and not the code of the file.

    The problem is you are including a page with a web url. You need to do one of the following to reference the FILE and not the URL:

    * use a relative path to the file such as – /home/userid/public_html/directory/file.php
    * or use a path such as – include(“$DOCUMENT_ROOT/file.php”);

    I have contacted paQman because I want to make something similar but he didn’t solve the problem.

    I found the relative path from my host – but it didn’t work as described here. So have ANY of you got this working so please describe exactly what you did, please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘using php in posts (trying to include a file)’ is closed to new replies.