0
votes

Im trying to run something like this:

<a href="login.php?logout=1" id="logout">logout</a>

<div id="main">

<?php require_once('getPhotos.php') ; ?>

<div id="response" class="hidden" />
</div><!-- end main-->

But Im getting this error.

Warning: require_once(1) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\myPhotosWebsite\index.php on line 17
Fatal error: require_once() [function.require]: Failed opening required '1' (include_path='.;C:\php5\pear') in C:\wamp\www\myPhotosWebsite\index.php on line 17

Any sugesstions...what iam doing wrong

5
error is quite clear, no? no such file. - SilentGhost

5 Answers

2
votes
  • does the getPhotos.php exist?
  • where is it?
  • is it written exactly like that?
2
votes

It can't find the file getPhotos.php in the folders c:\wamp\myPhotosWebsite\ or c:\php5\pear

0
votes

Your required file is not in the directory of the main script nor int the configured include dirs.

0
votes

better to always use

<?php require_once(".\getPhotos.php"); ?>

Don't forget that if you already use require to "run" your index.php (it should not be the case) then require("xxx.php") maybe doesn't open xxx.php in the same directory as index.php

0
votes

Looks rather weird. It does look weird because the error message says it can't open file "1", but not file "getPhotoes.php". It makes me think that string 'getPhotoes.php' is a part of arithmetic expression.

I suggest trying

  • replace single quotes with double quotes
  • remove space after closing bracket in require_once call.

Should look like this:

<?php require_once("getPhotos.php"); ?>

Another wild guess is that there is another require_once call in the file (or in another file that is required by require_once) which has an arithmetic expression in its argument.