Problem with an include script.

Status
Not open for further replies.

pokefan2

New Member
Messages
24
Reaction score
0
Points
0
I have been trying to fix an error with my include script for ages. I have retyped it several times with parentheses, quotes, apostrophes, and combinations. The file I am trying to include is in the same directory as the file i typed the include script on. It works when I put the files on my localhost... I am completely lost.
 

Nathan H

New Member
Messages
562
Reaction score
0
Points
0
could you please post your code, then we can look through to see any errors that are there
 

pokefan2

New Member
Messages
24
Reaction score
0
Points
0
<?php include "info.php";
include "connect.php";

The code is finished... I just did not post the rest of the code.
 

Nathan H

New Member
Messages
562
Reaction score
0
Points
0
try
PHP:
 include("info.php");
include("connect.php");
sometimes PHP can get a bit touchy

also check the capitilisation
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
It may also be a good idea to use the full path to the files (/home/username/public_html/ ..........)
This is supposed to speed up PHP execution slightly, but it probably won't make any noticeable difference.
 

pokefan2

New Member
Messages
24
Reaction score
0
Points
0
This is the error code that I keep getting.

Warning: include(info.php) [function.include]: failed to open stream: No such file or directory in /home/********/public_html/index.php on line 2

Warning: include() [function.include]: Failed opening 'info.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/********/public_html/index.php on line 2

Warning: include(connect.php) [function.include]: failed to open stream: No such file or directory in /home/********/public_html/index.php on line 4

Warning: include() [function.include]: Failed opening 'connect.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/********/public_html/index.php on line 4
 

tnl2k7

Banned
Messages
3,131
Reaction score
0
Points
0
Then the files aren't in the same folder as the script you're trying to run, that error means exactly what it says - PHP can't find the file.

-Luke.
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Weird... According to my file manager... it exists.
Someone else on IRC was having exactly the same problem yesterday. Nither of us could figure it out.
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
That's probably because your localhost is Windows, which ignores letter case in file names. The file is actually:

http://wolfmagic.x10hosting.com/Info.php

The uppercase "I" matters on linux machines, which is what the x10 servers are. I recommend renaming the file to info.php, especially if you include it in a number of different scripts.
 
Status
Not open for further replies.
Top