Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Include nie działa
Forum PHP.pl > Forum > Przedszkole
Kloc
Mam taki problem, gdy podam taką ścieżkę:

include('plik.php');

to działa, a gdy taką:

include('http://localhost/strona/plik.php');

to nie trybi. Wie ktoś dlaczego?
Na dodatek sypie mi takie błędy:

Cytat
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in E:\Xampp\htdocs\strona\index.php on line 3

Warning: include(http://localhost/strona/plik.php): failed to open stream: no suitable wrapper could be found in E:\Xampp\htdocs\strona\index.php on line 3

Warning: include(): Failed opening 'http://localhost/strona/plik.php' for inclusion (include_path='.;E:\Xampp\php\PEAR') in E:\Xampp\htdocs\strona\index.php on line 3

Fatal error: Class 'Template' not found in E:\Xampp\htdocs\strona\index.php on line 6
Rysh
Wcale się nie dziwię, że niedziała. To tak jak byś chciał dać:
  1. include('http://google.pl');

Cytat
If "URL include wrappers" are enabled in PHP, you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Supported Protocols and Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.

Kloc
A można to jakoś inaczej rozwiązać?
Turson
file_get_contents() / cURL
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.