Script Dying At include()

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I tried to run a simple script today on my PC (WinXP, PHP5, MySQL
4.0.17) that I haven't run for about a year, and for some reason it's
dying at an include() statement that used to work fine.  I double
checked to make sure the file is still there, and it is.  The weird
thing is, I'm not getting any type of error to tell me what the problem
is.  I tried

include(file.php) or die (mysql_error());

but still got no error.  I've had some other issues since I went to
PHP5, so I tried going back to 4.3.9, but I still have the same problem.
  The exact same setup on my laptop works just fine, so I know it's
something local to the PC.  Can anyone give me a suggestion as to why my
script would be dying at include()?



Re: Script Dying At include()



at the top of your script to debug this.

Re: Script Dying At include()

Maybe use something like the script below, just to verify if its looking in
the correct place.

if file_exists("file.php"){
else {
echo "<br> File not found<br>";

Quoted text here. Click to load it

Re: Script Dying At include()

Quoted text here. Click to load it

  or even better error_reporting(E_ALL | E_STRICT);

  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com

Re: Script Dying At include()


Quoted text here. Click to load it

You can't use an include like that. include/require are no functions,
they are special language constructs. Have a look at the manual for some
more details on how these constructs work and why the above can't work
as expected.

Quoted text here. Click to load it

Set error_reporting to E_ALL in your php.ini.

In an example like above I get a warning and the file is not included.


Site Timeline