I have a page called index.php which includes a page new_display.php which again includes two pages i.e. say x.php and y.php
The include is working fine on localhost but not on my hosting! The error i am getting is :-
Warning: require(/interests/sketching/udis.php) [function.require]: failed to open stream: No such file or directory in /hermes/bosweb/web054/b548/ipg.pingcampuscom/mysql/interests/sketching/new_display.php on line 154
Fatal error: require() [function.require]: Failed opening required '/interests/sketching/udis.php' (include_path='.:/usr/local/lib/php-5.2.17/lib/php') in /hermes/bosweb/web054/b548/ipg.pingcampuscom/mysql/interests/sketching/new_display.php on line 154
The Directories are :
index.php -> localhost/mysql
new_display.php -> localhost/mysql/interests/sketching/new_display.php ( Included in index.php as /interests/sketching/new_display.php )
then in new_display x.php and y.php are included as
/interests/sketching/x.php
/interests/sketching/y.php
It works all good in localhost but gives error when i publish the pages on the Domain
Does anyone has any idea why isn't this working?
/
indicates an absolute path, meaning your script is looking in the root of the filesystem for a directory calledinterests
.Instead, try just removing that
/
at the start of your paths, or prepend$_SERVER['DOCUMENT_ROOT']
to them.You have to make
Without
Because you have to point to the same folder ;).