By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

Include shows on my computer but not when uploaded

P: 3
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

Feb 15 '07 #1
Share this Question
Share on Google+
5 Replies

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

Call to undefined function include_path()

Feb 15 '07 #2

P: 202
Try re-writing your include statement

Expand|Select|Wrap|Line Numbers
  1. <?php include "includes/mainLinks.php"; ?> 
Good Luck
Feb 15 '07 #3

P: 35
Try re-writing your include statement

Expand|Select|Wrap|Line Numbers
  1. <?php include "includes/mainLinks.php"; ?> 
Good Luck
Is there any difference? All I see is the parenthesis removed. Is that different in how it includes?
Feb 16 '07 #4

Expert 5K+
P: 5,058

Try changing the line like this

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

It wouldn't matter on Windows, but I dont know about Linux or Mac.
Feb 16 '07 #5

P: 3
Thanks everyone and sorry for the super late reply... got it!!
Apr 12 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.