iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
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

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-14-2006, 09:54 AM
WebProWorld Member
 
Join Date: Jan 2006
Location: London
Posts: 76
WomenXtra RepRank 0
Default How to solve this (Include) issue in PHP

Hi web developers,

I am a newbie and stuck big big time!

My site has 3 includes on every page : the header.php, footer.php and the left_menu.php.

The includes for some reason used to work on one of the hosting servers. when I passed on the files to my friend to upload on their server - the content of the pages would show. but the none of the include files would display.

no error message
and no sign of anything wrong.

I checked the php config details..and it shows: vertual directory DISABLED!

NOW! could this be the reason? or am I missing something else?

Also, the files were not placed in the wwwroot folder, they were under: wwwroot/testing/

do i need to enable anything in directory level?

I am very lost and any suggestions would be really appreciated .

thanks
Tala
__________________
www.womenxtra.co.uk
Join our new community and take part in the discussions!
Reply With Quote
  #2 (permalink)  
Old 09-14-2006, 10:23 AM
WebProWorld Veteran
 
Join Date: Aug 2006
Location: Burlington, Ontario, Canada.
Posts: 407
jtracking RepRank 1
Default

I'd guess and it's most likely that your paths to your include files are not accurate in your main page.

Check very carefully and you'll probably find that's the case. I can't count how many times this happens to me right up to yesturday.

Let me know.
__________________
Post as-it-happens crime stories of criminal behaviour at crimedigg.com
Reply With Quote
  #3 (permalink)  
Old 09-14-2006, 04:21 PM
WebProWorld Veteran
 
Join Date: Jul 2005
Location: London - Cheswick
Posts: 669
JuniorOnline RepRank 0
Default HELP!

Hiya

ok, i need your help please, as I am feeling Xtremly lost!

my friend's API = Apache
mine is: CGI

does this make a difference why the files are not showing on his server?

What sort of modifications are needed for the files in order for them to function on his server?


thanks,
Tala
Reply With Quote
  #4 (permalink)  
Old 09-14-2006, 04:31 PM
WebProWorld Veteran
 
Join Date: Jul 2005
Location: London - Cheswick
Posts: 669
JuniorOnline RepRank 0
Default

when it comes to server side includes - its usually configured to allow/enable .shtml and html files to work. but my include files are not those. they are .php - does that mean I need to enable the CGI scripting side of things in order for it to work?

please please help!
Reply With Quote
  #5 (permalink)  
Old 09-14-2006, 09:55 PM
sands's Avatar
WebProWorld Veteran
 
Join Date: Sep 2005
Location: Kerala, India
Posts: 395
sands RepRank 1
Default

Quote:
they are .php - does that mean I need to enable the CGI scripting side of things in order for it to work?
No, for PHP includes all you need is PHP. The file extension should be .php
__________________
My Nook | My Biz | My Photos
Reply With Quote
  #6 (permalink)  
Old 09-15-2006, 05:35 AM
WebProWorld Veteran
 
Join Date: Jul 2005
Location: London - Cheswick
Posts: 669
JuniorOnline RepRank 0
Default

so why the files are not showing?
is there something I need to look into?

there are no error messages..thats the problem..
Reply With Quote
  #7 (permalink)  
Old 09-15-2006, 06:03 AM
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Cornwall, UK
Posts: 972
speed RepRank 1
Default

On the server it doesn't work on:

Create a file called test1.php
Code:
<?php
include('test2.php');
echo "Test 1
\n";
?>
In the same directory create a file called test2.php
Code:
<?php
echo "Test 2
\n";
?>
In your browser access test1.php, do you see 2 lines?

If the answer is yes then it's your paths are wrong in the includes if the answer is no then it's a PHP/Server issue.
Reply With Quote
  #8 (permalink)  
Old 09-15-2006, 06:15 AM
WebProWorld Veteran
 
Join Date: Jul 2005
Location: London - Cheswick
Posts: 669
JuniorOnline RepRank 0
Default

ok will do.. thanks a lot for getting back to me so quick!
Reply With Quote
  #9 (permalink)  
Old 09-17-2006, 08:47 AM
WebProWorld Veteran
 
Join Date: Jul 2005
Location: London - Cheswick
Posts: 669
JuniorOnline RepRank 0
Default

hi again,

the php files are not showing.. any ideas what do i need to do to the apache server to enable them to show?

thanks
Tala
Reply With Quote
  #10 (permalink)  
Old 09-17-2006, 09:08 AM
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Cornwall, UK
Posts: 972
speed RepRank 1
Default

If you access test2.php do you see 1 line of text, source, a download or nothing?

Assuming nothing for test2.php have you tried changing it's permissions so that it is not group writable? Does that help?

Do you know if this server in fact has PHP on it?

PS. Replied to PM
Reply With Quote
  #11 (permalink)  
Old 09-22-2006, 01:42 PM
WebProWorld New Member
 
Join Date: Sep 2006
Posts: 3
profsite RepRank 0
Default it may help u

hi
there may be many reasons for ur problem
1.)your cgi management is disabled plz enable it first.
2.)your one of three files header.php,left.php or footer.php has some code which require that needs to be extra script to be instal like gd library etc....

if u still face problem after this u can contact me at:
profsite-at-aol.com
Reply With Quote
  #12 (permalink)  
Old 09-25-2006, 05:16 AM
WebProWorld Veteran
 
Join Date: Jul 2005
Location: London - Cheswick
Posts: 669
JuniorOnline RepRank 0
Default

thanks a lot profsite - Speed has managed to sort it out for me. I also learned a lesson from all of this: getting ALL the facts before making a start on any task. The IT department was so stupid, they had no clue what the client needed in the first please.

all sorted now though

many thanks again:)
Reply With Quote
  #13 (permalink)  
Old 10-12-2006, 10:42 AM
lgoss's Avatar
WebProWorld New Member
 
Join Date: Aug 2006
Location: Lexington, KY
Posts: 21
lgoss RepRank 0
Default Not that this will solve your problem...

but use the require() function instead of include(). The include() function generates a warning (but the script will continue execution) while the require() function generates a fatal error (and the script execution will stop after the error). You don't want your scripts to continue executing if files are missing or misnamed. Just a little tip.
Reply With Quote
  #14 (permalink)  
Old 10-12-2006, 11:37 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,705
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default

Do they use php.ini where they set include paths?
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:42 PM.



Search Engine Optimization by vBSEO 3.3.0