PHP problem

I’ve loaded an index.php file and a file named user_functions.php to my web directory. The first line of index.php is:

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

If I access it, I get the following errors:

Warning: main(user_functions.php): failed to open stream: No such file or directory in /home/.katsumi/hmessing/ on line 1

Fatal error: main(): Failed opening required ‘user_functions.php’ (include_path=’.:/usr/local/lib/php’) in /home/.katsumi/hmessing/ on line 1

Excuse me if this is something obvious…but can someone explain what is going on here…thanks.

Are both of your files placed within the same directory? I see that index is present, but if you go to I get a 404 error saying that the file isn’t actually there. make sure it’s uploaded to the correct place, and that the name matches (remember that linux servers are CaseSensitiVe)

Hope this helps


Oops…embarassing…loaded wrong file and the katsumi threw me…ok now…

What is the .katsumi business anyway?

[quote]Oops…embarassing…loaded wrong file and the katsumi threw me…ok now…

What is the .katsumi business anyway?[/quote]
You can guarantee your includes work from anywhere by including them like this:<?php require_once($_SERVER['DOCUMENT_ROOT'].'/includes/include.php');?>That assumes you have the file in an “includes” directory in your web root ( It saves you from having to monkey around with relative paths.

.katsumi is the name of the server you happen to be on. Do not hard-code this, because it may change from time to time. It can be safely left out, like this:/home/hmessing/
Simon Jessey
Keystone Websites (business site) | si-blog (personal site with affiliate links)