Document_root problem

Hello there!

Well i have this little problem with document_root. In my php code, to get path of the server, i used $_SERVER[‘document_root’], so to access some files, i wrote:


the problem is, when i upload my files to your server, i get this errors:

Fatal error: require_once() [function.require]: Failed opening required ‘/users/zocky/www//public/news/public_news_class.php’ (include_path=’.:/etc/php/lib’) in /users/zocky/www/public/news/include_public_news.php on line 2

so the problem seems to bein the document root, but i don’t know exactly what the problem is. Does anyboy have any ideas?


Try to leave out the document root. Also there’s a slash overmuch - after the $_SERVER[‘DOCUMENT_ROOT’] variable doesn’t need to be another slash.

Ok tnx, it seems to work.

Another question, do you guys support .htaccess and .htpasswd files to redirect and protect files?

yes of course
a htaccess generator for protectiong your website you can find here … g,english/

Ok tnx a lot man!

One more question (yeah sorry for being annoying):
With php i create folders and upload via php images to that folder. Funny thing is, i can’t see those files in my ftp application (FileZilla), but i do know it is there as everything works correctly and when RMB on this image on my site, it clearly says that this image is located there. Do you perhabs know why is so?

also, can i also delete those folders or files with php too? I’m trying to achive this and it works on localhost, but not on this server.It doesn’t give me any errors though, so maybe the problem is path or something. Any ideas?


perhaps your ftp-client caches the results while you uploaded new images, which means that it will show you those images then when you (log out and) login again to refresh it’s cache.
why your scripts could not delete these files again might have several causes, bplaced uses a pretty secure configuration for php, also this might mean that your local host has e.g. register_globals enabled and your script requires the path to the file which is to be deleted from the given URL - so anyway, you might want to post us your code and how you used it to delete the file (for example, by giving the appropriate URL)


Tnx for helping!

Well, dunno what exactly was the problem with the ftp, but it seems to work now. And the problem with images not being deleted, seems to be in my script (on localhost too), must see where exactly is the problem. Shouldn’t be that hard.

Tnx again for helping guys (and gals :stuck_out_tongue:), sorry if i’m somewhat annoying.

and btw, here’s the site: