include werkt niet??

Status
Niet open voor verdere reacties.

nl18663

Gebruiker
Lid geworden
19 dec 2007
Berichten
156
als ik een file wil includen krijg ik de volgende melding... dat lijkt me niet goed:

[Mon Feb 09 16:23:55 2009] [error] [client 10.108.122.50] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening '1' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/test/index.php on line 12
[Mon Feb 09 16:23:55 2009] [error] [client 10.108.122.50] PHP Notice: Undefined variable: conffiles in /var/www/html/test/index.php on line 14
[Mon Feb 09 16:23:55 2009] [error] [client 10.108.122.50] PHP Notice: Undefined variable: conffiles in /var/www/html/test/index.php on line 17
[Mon Feb 09 16:23:55 2009] [error] [client 10.108.122.50] PHP Notice: Undefined variable: conffiles in /var/www/html/test/index.php on line 17

terwijl ik een gewone include gebruik:

include ("/var/www/http/www/test/include/filedetect.php");


kan iemand mij helpen? waarschijnlijk zit het ergens in de config van PEAR of php.ini
 
Je gebruikt een absolute verwijzing naar het bestand en dat is niet goed.

Je moet een relatieve verwijzing maken naar de include vanaf de pagina waarop die geïnclude wordt.

Als dat bestand in de map include staat wordt het dus:

PHP:
include('include/filedetect.php');
 
Je gebruikt een absolute verwijzing naar het bestand en dat is niet goed.

Je moet een relatieve verwijzing maken naar de include vanaf de pagina waarop die geïnclude wordt.

Als dat bestand in de map include staat wordt het dus:

PHP:
include('include/filedetect.php');

krijg ik nog steeds dezelfde error, ik heb zo'n vermoede dat er iets anders aan de hand is dan dat de include niet goed is:

[Mon Feb 09 16:50:49 2009] [error] [client 10.108.122.50] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening '1' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/test/index.php on line 12
[Mon Feb 09 16:50:49 2009] [error] [client 10.108.122.50] PHP Notice: Undefined variable: conffiles in /var/www/html/test/index.php on line 14
[Mon Feb 09 16:50:49 2009] [error] [client 10.108.122.50] PHP Notice: Undefined variable: conffiles in /var/www/html/test/index.php on line 17
[Mon Feb 09 16:50:49 2009] [error] [client 10.108.122.50] PHP Notice: Undefined variable: conffiles in /var/www/html/test/index.php on line 17

include ('include/filedetect.php');
 
Moet niet gekker worden...
als ik de functie scandir gebruik kent hij blijkbaar het pad niet of zoiets:

[Mon Feb 09 18:09:52 2009] [error] [client 10.108.122.50] PHP Warning: scandir(../logfiles) [<a href='function.scandir'>function.scandir</a>]: failed to open dir: No such file or directory in /var/www/html/test/index.php on line 17
[Mon Feb 09 18:09:52 2009] [error] [client 10.108.122.50] PHP Warning: scandir() [<a href='function.scandir'>function.scandir</a>]: (errno 2): No such file or directory in /var/www/html/test/index.php on line 17

dit is een Centos doos, ik ben er zelf niet zo bekent mee...
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan