|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi all
I am getting error in the php logs, when I call for the index.php that is made up of 3 inc's this is the error that I get. [13-May-2004 14:53:29] PHP Warning: main(C:/apache2/htdocs/inc/header1.php): failed to open stream: No such file or directory in C:\apache2\htdocs\giftdealsgalore\index.php on line 2 [13-May-2004 14:53:29] PHP Warning: main(): Failed opening 'C:/apache2/htdocs/inc/header1.php' for inclusion (include_path='.;c:\apache2\php;c:\apache2\php\sma rty;c:\apache2\php\pear;c:\apache2\php\pear\pear') in C:\apache2\htdocs\giftdealsgalore\index.php on line 2 It's not that I don't understand that the inc dir. needs to be in the dir. of giftdealgalore it is according to the file structure at the command promt. It appears to me that php looked for the inc here 'C:/apache2/htdocs/inc/header1.php' when it should have looked here 'C:/apache2/htdocs/giftdealsgalore/inc/header1.php' everything works fine on the remote host this is on localhost. any ideas Mike |
|
|||
|
What is the code you are using to call the files?
|
|
|||
|
Thanks Jestep
This is the code, and this has given me a idea that maybe calling for the code locally may be different than callin it remotelly I may not have local site set up right yet still very confusing. Think I will change what is below <?php include $_SERVER['DOCUMENT_ROOT']."/inc/header1.php"; include $_SERVER['DOCUMENT_ROOT']."/inc/leftcol.php"; include $_SERVER['DOCUMENT_ROOT']."/inc/rightcol.php"; ?></div> </div> <div align="center"> [img]/giftsgalore_1aaa.jpg[/img]</p> </p> </p> </div> </div> </body> </html> to <?php include $_SERVER['DOCUMENT_ROOT']."/giftdealsgalore/inc/header1.php"; include $_SERVER['DOCUMENT_ROOT']."/giftdealsgalore/inc/leftcol.php"; include $_SERVER['DOCUMENT_ROOT']."/giftdealsgalore/inc/rightcol.php"; ?></div> </div> <div align="center"> [img]/giftsgalore_1aaa.jpg[/img]</p> </p> </p> </div> </div> </body> </html> Do you think maybe that is it Mike |
|
|||
|
Try
include "./giftdealsgalore/inc/header1.php"; |
|
|||
|
Hi Jestep
include "./giftdealsgalore/inc/header1.php"; Well that did work. Thanks Hi Ron I think I will try your way too a little later. There still must be something wrong though, because I thought that I should have the same file structure for the remote and testing server. Mike |
|
|||
|
Quote:
|
|
|||
|
Yes Ron that's right I think that on the testing or localhost the doc root is in the wrong place. So what you are saying is that using $app_root_path = './'; in the inc file on the remote server and on the testing server will allow both to work properly. What my goal is, is to have the same exact files on the remote and testing (afraid I will upload the wrong set to one or the other) I want to mirrow my remote.
Mike |
|
||||
|
Yes. Using a variable to store the current directory in will make the code portable.
I had the same problem you are going thru, and learned it the hard way. ;0) I have a local server too ... and the directory for some of the sites are two or three levels up from the root. So I know that it works. Example Webstractions Test Site and another test site. Both sites use a path variable to establish what directory they are in. The code can be transferred to any other directory or the root of a server and still work. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2010 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |