iis - include once with azure web php in folder -


i try include

in folder wwwroot/sample/printsample.php

i write code

  <?php             include_once("testerror/warning.php");   ?> 

and

in folder wwwroot/testerror/warning.php

i write code

<?php      echo "hello world";  ?> 

when try access via web site example.com/sample/printsample.php, result nothing.

but when include in full path in include_once in sample/printsample.php

like this

<?php    include_once("d:\home\site\wwwroot\useblockscript\testerror\warning.php"); ?> 

i result in web print "hello world".

what wrong it?

look script located in d:\home\site\wwwroot. looks relative path. should d:\home\site\wwwroot\testerror\warning.php

this excerpt $_server

[script_filename] => d:\home\site\wwwroot\useblockscript\test.php [request_uri] => /useblockscript/test.php [path_translated] => d:\home\site\wwwroot\useblockscript\test.php [document_root] => d:\home\site\wwwroot [appl_physical_path] => d:\home\site\wwwroot\ [http_x_original_url] => /useblockscript/test.php [php_self] => /useblockscript/test.php 

you can try

include_once ($_server['document_root']."testerror/warning.php");

the reason failing because haven't gave , absolute include path, searching (relative path) in printsample.php file path ie " wwwroot/sample".


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -