Connecting Tech Pros Worldwide Forums | Help | Site Map

Include shows on my computer but not when uploaded

Newbie
 
Join Date: Feb 2007
Posts: 3
#1: Feb 15 '07
Hello, I have been trying to learn PHP and have been spending all day trying to solve this "simple" problem. I am using Mac OS X 10.4. I am trying to create a site for myself that gets me out of always having to update main navigation links on every page by learning how to use a server side include.

I created a index page with the following include:

[PHP] <?php include("includes/header.php"); ?> [/PHP]

The header is just a simple nav bar with html text links. This works fine the header is displayed properly on top of the index page.

Within this header I am trying to have another include in a table cell for another set of links. This is what is not working. I have tried this code in a table cell as follows:

[PHP] <?php include("includes/mainLinks.php"); ?> [/PHP]

so basically I have an index page that brings in a header with links and a header that brings in another set of links. So one index file and two includes.

Everything works fine on my computer but when uploaded I get this error:

Warning: main() [function.main]: open_basedir restriction in effect. File(/usr/share/pear//mainLinks.php) is not within the allowed path(s):

Any help would be appreciated

Thanks

Newbie
 
Join Date: Feb 2007
Posts: 3
#2: Feb 15 '07

re: Include shows on my computer but not when uploaded


I have been trying to figure this out more and have been getting this error:

Call to undefined function include_path()

thanks
cassbiz's Avatar
Familiar Sight
 
Join Date: Oct 2006
Location: Florida
Posts: 204
#3: Feb 15 '07

re: Include shows on my computer but not when uploaded


Try re-writing your include statement

Expand|Select|Wrap|Line Numbers
  1. <?php include "includes/mainLinks.php"; ?> 
  2.  
Good Luck
Member
 
Join Date: Nov 2006
Posts: 34
#4: Feb 16 '07

re: Include shows on my computer but not when uploaded


Quote:

Originally Posted by cassbiz

Try re-writing your include statement

Expand|Select|Wrap|Line Numbers
  1. <?php include "includes/mainLinks.php"; ?> 
  2.  
Good Luck

Is there any difference? All I see is the parenthesis removed. Is that different in how it includes?
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,753
#5: Feb 16 '07

re: Include shows on my computer but not when uploaded


Hi

Try changing the line like this

[php]
// From
<?php include("includes/mainLinks.php"); ?>
// To
<?php include("./includes/mainLinks.php"); ?>
[/php]

It wouldn't matter on Windows, but I dont know about Linux or Mac.
Newbie
 
Join Date: Feb 2007
Posts: 3
#6: Apr 12 '07

re: Include shows on my computer but not when uploaded


Thanks everyone and sorry for the super late reply... got it!!
Reply