The include() function in PHP?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
54 views
I can not understand... regardless of, whether the local machine or on a virtual server the following happens:

On the local server

Included:
<? include("functions.php"); ?>


Not included:
<? include("http://localhost/functions.php"); ?>

On the remote server

Included:
<? include("functions.php"); ?>


Not included:
<? include("http://site.ru/functions.php"); ?>

On the local server (file in directory)

Included:
<? include("./dir/functions.php"); ?>


Not included:
<? include("http://localhost/dir/functions.php"); ?>


On the remote server (file in directory)

Included:
<? include("./dir/functions.php"); ?>


Not included:
<? include("http://site.ru/dir/functions.php"); ?>


Read the manuals, they say that inkluda work only nonlocal. Then it turns out the opposite chtoli... I need to includet it to the address of the file (site.ru/functions.php), and not relative.
by | 54 views

5 Answers

0 like 0 dislike
In php.ini setting allow_url_include needs to be On. Just do not forget about safety.
by
0 like 0 dislike
you must not want to includethe deleted files
surely there are alternative ways of solving the problem.
\r
includit to have only local files
by
0 like 0 dislike

I use $_SERVER['DOCUMENT_ROOT'] and no trouble do not know )))

by
0 like 0 dislike
if to php.ini does not have access, it is possible to .htaccess add a line php_value allow_url_include On
by
0 like 0 dislike
Read the manuals, they say that inkluda work only nonlocal.

What kind of manuals are these?
by

Related questions

0 like 0 dislike
1 answer
asked Jun 12, 2019 by Shing
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Jun 8, 2019 by Vakha1
0 like 0 dislike
1 answer
asked Jun 6, 2019 by Expensiv789
0 like 0 dislike
2 answers
asked May 10, 2019 by mozart_dima
110,608 questions
257,186 answers
0 comments
28,048 users