Jump to content

include_path='.:/usr/share/pear'


fmcgenesis

Recommended Posts

I'm back.

 

Got almost everything working on the server but there's one little thing I can't figure out.

 

I'm getting the following error on my site at http://fmcclan.com/ (Note: I have been turning that block on and off so you may not see the error)

 

Warning: include(http://www.fmcclan.com/modules/vwar/extra/countdown.php) [function.include.html]: failed to open stream: Permission denied in /var/www/html/fmc/blocks/block-vWarCount.php on line 26

Warning: include() [function.include.html]: Failed opening 'http://www.fmcclan.com/modules/vwar/extra/countdown.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/fmc/blocks/block-vWarCount.php on line 26

 

What's pear and what's wrong here?

Link to comment
https://forums.phpfreaks.com/topic/39081-include_pathusrsharepear/
Share on other sites

I'm back.

 

Got almost everything working on the server but there's one little thing I can't figure out.

 

I'm getting the following error on my site at http://fmcclan.com/ (Note: I have been turning that block on and off so you may not see the error)

 

Warning: include(http://www.fmcclan.com/modules/vwar/extra/countdown.php) [function.include.html]: failed to open stream: Permission denied in /var/www/html/fmc/blocks/block-vWarCount.php on line 26

Warning: include() [function.include.html]: Failed opening 'http://www.fmcclan.com/modules/vwar/extra/countdown.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/fmc/blocks/block-vWarCount.php on line 26

 

What's pear and what's wrong here?

 

this is wrong

include("http://www.fmcclan.com/modules/vwar/extra/countdown.php");

this is right

include("../modules/vwar/extra/countdown.php");
or if your already in the main directory use the fallowing
include("modules/vwar/extra/countdown.php");

Tried both of your suggestions

 

Warning: include(vwar/extra/countdown.php) [function.include.html]: failed to open stream: No such file or directory in /var/www/html/fmc/blocks/block-vWarCount.php on line 26

Warning: include() [function.include.html]: Failed opening 'vwar/extra/countdown.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/fmc/blocks/block-vWarCount.php on line 26

Tried both of your suggestions

 

Warning: include(vwar/extra/countdown.php) [function.include.html]: failed to open stream: No such file or directory in /var/www/html/fmc/blocks/block-vWarCount.php on line 26

Warning: include() [function.include.html]: Failed opening 'vwar/extra/countdown.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/fmc/blocks/block-vWarCount.php on line 26

 

php can't see it because your include_path only looks in /usr/share/pear. Either modify your php.ini or do this

include($_SERVER['DOCUMENT_ROOT']."/PATH");

PATH being the path to the file under the document root.

What do I need to change in php.ini exactly?

 

Sorry I'm new to modifying php files on the server side.

 

The line that starts with

include_path =

 

In your case it should now read

include_path = ".:/usr/share/pear"

 

In the above you would add a colon after pear and put in the full path to the directory of the included files.

added;

 

include_path = ".:/usr/share/pear"

 

no change.

 

Of course not. After /usr/share/pear you add a colon and the full path to your include files. As in

include_path = ".:/usr/share/pear:/var/www/html/fmc/blocks/"

If your include files are in /var/www/html/fmc/blocks/

Yes I did restart the service, always do.

 

I haven't tried the suggestion about yet because I don't understand why I need to modify php.ini for content on my webpage. I was hosted on a shared hosting in normal conditions one wouldn't have access to php.ini - on my shared hosting this worked fine but on my server it's not.

 

Perhaps I think I don't want to make static changes to php.ini because it should work without it... any suggestions?

 

EDIT: Just tried your suggestion with no change....  ???

On the server, find the directory where the include files are located, do a "pwd" and paste it here.

 

 

P.S. You might want to fix the front page of your site. I am coming from my companies network and am getting the following message

----

"You have attempted to access this site with an invalid IP.

 

If you think this is a mistake you can contact the site webmaster at genesis(at)fmcclan(dot)com.

 

Be SURE to include the following information in any email!

User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

Remote Address: REMOVED by joder

Client IP: none

Forwarded For: REMOVED by joder

----

which is wrong since my company owns the IP address block in question.

If you are getting a permissions denied error then it nothing to do with the include_path but the permissions on the file you are trying to include. By permissions I mean the CHMOD permissions.  These permissions are very important. 0644 should be fine.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.