{PHP: foo.php} I am too stupid ?
{PHP: foo.php} I am too stupid ?
{PHP: foo.php} works
{PHP: test/php} doesn't work
What´s wrong?
Ciao
Tom
{PHP: test/php} doesn't work
What´s wrong?
Ciao
Tom
Re: {PHP: foo.php} I am too stupid ?
If you mean:eflexer wrote:{PHP: foo.php} works
{PHP: test/php} doesn't work
What´s wrong?
Ciao
Tom
Code: Select all
{PHP: test/foo.php}
example: {PHP:phpwcms/test/foo.php}$phpwcms["root"]/test/foo.php
Yep, my root folder is "sub", my Replacement is
and the error-message is
Code: Select all
{PHP: sub/test/index.php}
Code: Select all
Warning: include_ext_php( sub/test/index.php): failed to open stream: No such file or directory in C:\Inetpub\wwwroot\sub\include\inc_front\front.func.inc.php on line 955
Solved
Code: Select all
{PHP: ../../test/index.php}
is working in this example
if you look at your error code above there is a space
so try making sure it is {PHP:myfile.php} where there is no space inbetween the : and filename. [/quote]
and the error-message is
Code:
Warning: include_ext_php( sub/test/index.php): failed to open stream: No such file or directory in C:\Inetpub\wwwroot\sub\include\inc_front\front.func.inc.php on line 955
so try making sure it is {PHP:myfile.php} where there is no space inbetween the : and filename. [/quote]
The space doesn't matter.
It works so
or so
Only this
doesn´t work, because it is rather a php include problem.
I am a php-newbie therefore it is need a little time to figure out.
If file A includes file B and file B wants to include file C and the files are in different directories there can be complications, because file B's include path automatically shifts to whatever file A's may be. A bit confusing to say the least.
A work around for this
then, at the top of every php page, before any other includes, include
path.php.
Then, before any include statements, use the BASE global.
Now you simply structure all includes to be relative to the project's base
directory, and every page will know how to get there.
Ciao
Tom
It works so
Code: Select all
{PHP:../../include/inc_ext/apps/intern/index.php}
Code: Select all
{PHP: ../../include/inc_ext/apps/intern/index.php}
Code: Select all
{PHP:/sub/test/index.php}
I am a php-newbie therefore it is need a little time to figure out.
If file A includes file B and file B wants to include file C and the files are in different directories there can be complications, because file B's include path automatically shifts to whatever file A's may be. A bit confusing to say the least.
A work around for this
Code: Select all
define("BASE", "path-to-root-project-directory");
path.php.
Then, before any include statements, use the BASE global.
Code: Select all
include "library.php" becomes:
include BASE."library.php"
directory, and every page will know how to get there.
Ciao
Tom
This isn't "actually" quite true. If your file to "insert" is in:eflexer wrote:Only thisdoesn´t work, because it is rather a php include problem.Code: Select all
{PHP:/sub/test/index.php}
~and phpWCMS's file named "phpwcms.php" is in:C:/Inetpub/wwwroot/sub/test/index.php"
then I "believe" you should enter:C:/Inetpub/wwwroot/sub/phpwcms.php"
Code: Select all
{PHP:sub/test/index.php}
Code: Select all
{PHP:../test/index.php}
(The "called" file then "inherits" the URL path of the "calling" function, which in this case... is phpWCMS's root http://www.mydomain.com/sub/"