/    Sign up×
Community /Pin to ProfileBookmark

hi all today my friend asked me to fix up his php clan script when i went to test the clan script on my own personal website i got these errors

Warning: Unknown(): open_basedir restriction in effect. File(/home/william/public_html/clanscripts/index.php) is not within the allowed path(s): (/home/guru/:/usr/lib/php:/usr/local/lib/php:/tmp) in Unknown on line 0

Warning: Unknown(/home/william/public_html/clanscripts/index.php): failed to open stream: Operation not permitted in Unknown on line 0

Warning: Unknown(): open_basedir restriction in effect. File(/home/william/public_html/clanscripts/index.php) is not within the allowed path(s): (/home/guru/:/usr/lib/php:/usr/local/lib/php:/tmp) in Unknown on line 0

Warning: Unknown(/home/william/public_html/clanscripts/index.php): failed to open stream: Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening ‘/home/william/public_html/clanscripts/index.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in Unknown on line 0

I Dont know wat those mean how can i fix them?

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@Heavy_MetalJul 07.2006 — I am not sure, but it looks like it might be some bad permissions because its talkign about failed to open stream and not permitted and such. It also might be more helpful if you posted the code that you are getting these errors from, That usually helps people help you quicker.
Copy linkTweet thisAlerts:
@william232authorJul 07.2006 — here is the code

<?php
require("functions.php");
newView();
global $fontString, $fontString2, $headString;
$result11 = @mysql_query("SELECT * FROM status");
$li = mysql_fetch_array($result11);
extract($li);

<i> </i>if($li[li] == 1) {
dpli();
}
if(ipban($REMOTE_ADDR) == 1) {
$sql = "SELECT * FROM medals";
$result1 = mysql_query($sql) or die ("&lt;p&gt;$sql&lt;P&gt;".mysql_errno().": ".mysql_error());
$medrow = mysql_fetch_array($result1);
$result = @mysql_query("SELECT * FROM sec");
$row = mysql_fetch_array($result);
$result2 = @mysql_query("SELECT * FROM status");
$row2 = mysql_fetch_array($result2);
extract($row);
?&gt;


&lt;p align=center&gt;
&lt;img border="0" src="backstabmid.jpg"&gt;
&lt;/p&gt;



&lt;center&gt;&lt;table width=300 border=1 cellspacing=1 cellpadding=0 borderColorLight=gray borderColorDark=black&gt;
&lt;TR&gt;&lt;TD colspan=2 background='/images/bg6.gif'&gt;&lt;center&gt;&lt;b&gt;&lt;font size=1 color=white face=verdana&gt;Statistics Since August 14, 2003&lt;/center&gt;&lt;/font&gt;&lt;/b&gt;&lt;/TD&gt;&lt;/TR&gt;




&lt;?

$result3 = @mysql_query("SELECT * FROM counthits WHERE id = "1"");

$row3 = mysql_fetch_array($result3);

extract($row3);

$page1 = $row3[page];

?&gt;

&lt;TR&gt;&lt;TD&gt;&lt;center&gt;&lt;font size=1 color=#76A5D5 face=verdana&gt;Total Pages Viewed: &lt;/font&gt;&lt;font size=1 color=white face=verdana&gt;&lt;? echo $page1 ?&gt;&lt;/font&gt;&lt;/center&gt;&lt;br&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/table&gt;&lt;/center&gt;



&lt;?
require("useronline.php");
include("membersonline.php");
?&gt;


&lt;br&gt;&lt;br&gt;&lt;table width=300 border=1 cellspacing=1 cellpadding=0 borderColorLight=gray borderColorDark=black&gt;
&lt;TR&gt;&lt;TD background='/images/bg6.gif'&gt;&lt;center&gt;&lt;b&gt;&lt;font size=1 color=white face=verdana&gt;Current Clan Security Level&lt;/center&gt;&lt;/font&gt;&lt;/b&gt;&lt;/TD&gt;
&lt;TD background='/images/bg6.gif'&gt;&lt;center&gt;&lt;b&gt;&lt;font size=1 color=white face=verdana&gt;Current Recruiting Status&lt;/center&gt;&lt;/font&gt;&lt;/b&gt;&lt;/TD&gt;&lt;/TR&gt;


&lt;?
if($sec == 5) echo("&lt;TR&gt;&lt;TD&gt;&lt;center&gt;&lt;img src=images/securitylevel/4.gif&gt;&lt;/img&gt;&lt;/center&gt;&lt;/TD&gt;");
if($sec == 4) echo("&lt;TR&gt;&lt;TD&gt;&lt;center&gt;&lt;img src=images/securitylevel/3.gif&gt;&lt;/img&gt;&lt;/center&gt;&lt;/TD&gt;");
if($sec == 3) echo("&lt;TR&gt;&lt;TD&gt;&lt;center&gt;&lt;img src=images/securitylevel/2.gif&gt;&lt;/img&gt;&lt;/center&gt;&lt;/TD&gt;");
if($sec == 2) echo("&lt;TR&gt;&lt;TD&gt;&lt;center&gt;&lt;img src=images/securitylevel/1.gif&gt;&lt;/img&gt;&lt;/center&gt;&lt;/TD&gt;");
if($sec == 1) echo("&lt;TR&gt;&lt;TD&gt;&lt;center&gt;&lt;br&gt;&lt;img src=images/securitylevel/0.gif&gt;&lt;/img&gt;&lt;/center&gt;&lt;/TD&gt;");
if($recruiting == 1) echo("&lt;TD&gt;&lt;center&gt;&lt;img src=images/RecruitClosed.gif&gt;&lt;/img&gt;&lt;/center&gt;&lt;/TD&gt;&lt;/TR&gt;");
if($recruiting == 0) echo("&lt;TD&gt;&lt;center&gt;&lt;br&gt;&lt;img src=images/RecruitOpen.gif&gt;&lt;/img&gt;&lt;/center&gt;&lt;/TD&gt;&lt;/TR&gt;");
}

include("footer.php"); ?&gt;


Thanks
Copy linkTweet thisAlerts:
@NogDogJul 07.2006 — It means that open_basedir has a directory specified for it in your PHP configuration, and therefore it does not allow you to open any files from within the script unless those files are in the specified directory or one of its sub-directories. I suspect the fopen(), file_get_contents() or other related functions that are generating those errors are in one or more of the files which are included/required by the script above, as a quick scan does not reveal any such functions in the main script.
Copy linkTweet thisAlerts:
@william232authorJul 07.2006 — How can i fix this?
Copy linkTweet thisAlerts:
@william232authorJul 07.2006 — My friend gave me another script and now i get this code error

Fatal error:Call to undefined function mcrypt_module_open() in .../clanscripts/main.php on line 33

but when i go to line 33 i find

[code]
$td=mcrypt_module_ope(MYCRYPT_BLOWFISH,"",MCRYPT_MODE_ECB,"/usr/lib/mcrypt_modes");
[/CODE]


what is that doing or looking for or wat does that even do php doesnt explain it very well
Copy linkTweet thisAlerts:
@NogDogJul 07.2006 — How can i fix this?[/QUOTE]
Either change the open_basedir setting in the php.ini file or else in a .htaccess file in the script's directory.
Copy linkTweet thisAlerts:
@NogDogJul 07.2006 — My friend gave me another script and now i get this code error

Fatal error:Call to undefined function mcrypt_module_open() in .../clanscripts/main.php on line 33

but when i go to line 33 i find

[code]
$td=mcrypt_module_ope(MYCRYPT_BLOWFISH,"",MCRYPT_MODE_ECB,"/usr/lib/mcrypt_modes");
[/CODE]


what is that doing or looking for or wat does that even do php doesnt explain it very well[/QUOTE]

It probably means that your PHP installation was not installed with the MCrypt library enabled. See http://www.php.net/mcrypt for more info.
Copy linkTweet thisAlerts:
@william232authorJul 07.2006 — How to i install it on my system because i am not on a shell server its a localhost for testing the script how can i install it so i can test it
×

Success!

Help @william232 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...