Take the 2-minute tour ×

When a person shares a link to the website http://www.fatboyscharity.co.uk/ by typing the web address into their status update on fb, the following is being displayed underneath the link to the website: -

:require(connect.php)[function.require]: failed to open stream: No such file or directory in /websites/folder/another_folder/.....etc.../public_html

I'm really quite worried about the direct link to my database connection is being displayed for the whole world to see on facebook - especially as the file does exist!!

This seems to happen whoever shares the link and we haven't even tried to implement any facebook stuff on the actual website.

The index page for the website is manufactured from a number of included php files (head.php, content.php, foot.php for example go together to make one page), some or all of which call for functions from other files.

I've never seen this happen before and really need to prevent it somehow.

Any help appreciated.



share|improve this question
I shared your link on my facebook wall for test and it works fine –  user1646111 Feb 1 '13 at 21:39

2 Answers 2

up vote 0 down vote accepted

Make sure connect.php is in the right folder and readable, and disable errors:

 <?php display_errors(false);

Also, you dont have to worry about the details of your connection being exposed, as long as your files ends with .php (and you put it in valid php code...)

share|improve this answer
The file was there but the error reporting was also set to E_ALL so maybe something to do with the order in which they were being called. Appears fine now that minor change has been made. Valid php code in .php files so reassured thanks - been a heavy day with man-flu but thanks so much for your help. Ian –  Ian Stevenson Feb 1 '13 at 23:18

well somehwere it tries to find connect.php file and cant find it. thats what the error message is screaming. Anyways before trying to open a file in any part of your code you need to check if file actually exists using file_exists and then use it, that way you will avoid having this kind of errors generating to different pages.

share|improve this answer
Thanks but the error message wasn't resulting in the php function not being called (because it's there) - that is what was confusing me, the page was rendering properly but FB was showing an error when the link to that page was shared on FB. I also only tend to use file_exists() when uploading, changing or updating files held on the server (such as a static database or csv) as opposed to page includes. Just my way I guess :-) –  Ian Stevenson Feb 1 '13 at 23:25

Your Answer


