/    Sign up×
Community /Pin to ProfileBookmark

error in local server instalation

hello, im trying to install on my localserver a youtube like script
im in step 3 from instalation, the databse and tables are installed, directories are given now:

[CODE]Fatal error: Undefined class name ‘sconfig’ in c:program fileseasyphp1-8wwwyoutubeincludeconfig.php on line 39[/CODE]

config.php:

[code=php]require_once($config[‘BASE_DIR’].’/classes/SError.php’);
require_once($config[‘BASE_DIR’].’/include/adodb/adodb.inc.php’);
require_once($config[‘BASE_DIR’].’/include/phpmailer/class.phpmailer.php’);
require_once($config[‘BASE_DIR’].’/classes/SEmail.php’);

$DBTYPE = ‘mysql’;
$DBHOST = SConfig::get(“Database”, “host”); <<< [line 39]
$DBUSER = SConfig::get(“Database”, “user_name”);
$DBPASSWORD = SConfig::get(“Database”, “password”);
$DBNAME = SConfig::get(“Database”, “db_name”);

$conn = &ADONewConnection($DBTYPE);
$conn->PConnect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME);

$sql = “SELECT * from sconfig”;
$rsc = $conn->Execute($sql);[/code]

what should i do?
thx

to post a comment
PHP

14 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 24.2006 — Did the distribution include a file called "SConfig.php"? If so, add it to the files that you require at the beginning of the code. If not, you'd best contact the author(s) of the script you're using.
Copy linkTweet thisAlerts:
@KrizaauthorSep 26.2006 — the sconfig.php is in the classes directory

what should i add to what page
Copy linkTweet thisAlerts:
@NogDogSep 26.2006 — With the other "require_once" commands:
[code=php]
require_once($config['BASE_DIR'].'/classes/SConfig.php');
[/code]

Make sure the capitalization of "SConfig.php" exactly matches that of the file name.
Copy linkTweet thisAlerts:
@KrizaauthorSep 28.2006 — thanks guys, i figured out the problem, i was putting the wrong DIR .

anyway i have another question.

now another problem:

[CODE]Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in c:program fileseasyphp1-8wwwsiteupload.php on line 84[/CODE]

what does that mean?

thanks
Copy linkTweet thisAlerts:
@NogDogSep 28.2006 — See [url=http://www.php.net/manual/en/language.references.pass.php]this page[/url], particularly the 2nd paragraph.

Presumably line 84 has a function call that looks something like:
<i>
</i>foo([color=red]&amp;[/color]$bar)

Instead of passing a variable by reference when calling the function, the currently approved method is to define the function with that argument as a "pass by reference" value:
<i>
</i>function foo(&amp;$bar)
{
// ...
}

Then you would call it without the "&" before the variable, such as:
<i>
</i>$someVariable = "some value"
foo($someVariable);
Copy linkTweet thisAlerts:
@KrizaauthorSep 29.2006 — ok, i didnt understand the concept but here's wts happening and u tell me what to do:

it's a youtube like site,im fixing some stuff on my local server

if i click on the upload.php link while im not logged in to my account on the site i will get the "Warning: Call-time pass-by-reference..." only

if i click on upload.php link while im logged in then ill get the page loaded and on top of it the "Warning: Call-time pass-by-reference..."

in upload.php:
if($_POST[upload_final]!="")
{
if($_FILES['field_uploadfile']['tmp_name']=="") $err="Please provide the video location.";
if($err=="" &amp;&amp; $_FILES['field_uploadfile']['tmp_name']!="")
{
$p=$_FILES['field_uploadfile']['name'];
$pos=strrpos($p,".");
$ph=strtolower(substr($p,$pos+1,strlen($p)-$pos));
/* Space in Megabytes (MB) */
$space = round($_FILES['field_uploadfile']['size']/(1024*1024));
if($config['enable_package']=="yes")
{
check_subscriber($space);
}

<i> </i> if(($ph!="mpg" &amp;&amp; $ph!="avi" &amp;&amp; $ph!="mpeg" &amp;&amp; $ph!="wmv" &amp;&amp; $ph!="rm" &amp;&amp; $ph!="dat") || $space&gt;$config[max_video_size])
<i> </i> $err="Invalid Video Format.";
<i> </i> }

<i> </i> if($err=="")
<i> </i> {
<i> </i> $sql="insert into video set
<i> </i> UID=$_SESSION[UID],
<i> </i> title='$_REQUEST[field_myvideo_title]',
<i> </i> description='$_REQUEST[field_myvideo_descr]',
<i> </i> keyword='$_REQUEST[field_myvideo_keywords]',
<i> </i> channel='0|$_REQUEST[listch]|0',
<i> </i> space = '$_REQUEST[space]',
<i> </i> addtime='".time()."',
<i> </i> adddate='".date("Y-m-d")."',
<i> </i> vkey='".mt_rand()."',
<i> </i> type='$_REQUEST[field_privacy]',
<i> </i> filehome='$_REQUEST[p]'";
<i> </i> $conn-&gt;execute($sql);
<i> </i> $vid=mysql_insert_id();
<i> </i> $vdoname=$vid.".".$ph;

<i> </i> if(isset($_FILES['field_uploadfile']['tmp_name']) &amp;&amp; is_uploaded_file($_FILES['field_uploadfile']['tmp_name']))
<i> </i> {
<i> </i> $ff = $config[vdodir]."/".$vdoname;
<i> </i> if(move_uploaded_file($_FILES['field_uploadfile']['tmp_name'], $ff))
<i> </i> { $mov = new ffmpeg_movie($ff);
[u] video_to_frame($ff,$vid,&amp;$mov,$listch[0]); [/u]
$duration=$mov-&gt;getDuration();
exec("$config[ffmpeg] -i $config[vdodir]/$vdoname -acodec mp3 -ar 22050 -ab 32 -f flv $config[flvdodir]/".$vid.".flv");
}

<i> </i> }
<i> </i> //END

the underlined code is line 84

1st: the site needs php-ffmpeg extension available on the server but it's not there now, is there a direct relation with THIS problem?

2nd: the error msg sayd "If you would like to pass it by reference" , why there's an if? and why they didnt pass it by reference from the start to solve the problem

3rd: they mentioned the .INI file in the error msg, wt should i do with it.

now call me dumb and tell me what to do without destroying my code, if u want more files or code i can give them to u.

thanks alot
Copy linkTweet thisAlerts:
@NogDogSep 29.2006 — The quick-and-dirty solution is to suppress error reporting on the function call. This is not the best solution by any means, but should get you around this problem with the least amount of trying to figure out what someone else's code is doing.
<i>
</i> [color=red][b]@[/b][/color]video_to_frame($ff,$vid,&amp;$mov,$listch[0]);

What you're running into is code that was probably written some time (years?) ago in a PHP version where this was accepted coding style, but has since become deprecated. It will work for now, but is not guaranteed to work in later versions, and thus it is throwing a warning to let you know this.

The better solution for the long term is to find out where the video_to_frame() function is defined, and change its definition so that the third argument is defined as being passed by reference...
<i>
</i>function video_to_frame($arg1, $arg2, [color=red][b]&amp;[/b][/color]$arg3, $arg4)
{
// body of function definition
}

...and then removing the "&" from where you call the function.

However, this would also mean locating any other calls to this function throughout the application and making sure that the above change in the function definition would not have an undesired side-effect, and therefore it may possibly be more of an issue than just adding an ampersand to the code. Thus I'm recommending the simple error-suppression solution for now, unless someone with time on his/her hands wants to search through all of the code and do the impact analysis for changing the function definition.
Copy linkTweet thisAlerts:
@KrizaauthorSep 30.2006 — aha

thanks nogdog

i understand what's happening now.. thanks to u. i'll see if the code works online, if it doesnt, ill do the hard work.

now the noobest question ever : how do u disable the error reporting
Copy linkTweet thisAlerts:
@NogDogSep 30.2006 — ...now the noobest question ever : how do u disable the error reporting[/QUOTE]
You can suppress error-reporting for a specific function call by prepending a "@" to the function. As in my preceding post:
[code=php]
@video_to_frame($ff,$vid,&$mov,$listch[0]);
[/code]
Copy linkTweet thisAlerts:
@KrizaauthorSep 30.2006 — i added the "@" but nothing changed

the error kept on showing

@video_to_frame($ff,$vid,&$mov,$listch[0]);
Copy linkTweet thisAlerts:
@NogDogSep 30.2006 — OK, time to get tough. Looks like you'll either need to change the allow_call_time_pass_reference setting in your php.ini file, or else in a .htaccess file (if you're running on Apache). If you opt for the .htaccess method (or have to because you don't control the server), simply create a (or edit an existing) file named [b].htaccess[/b] (note the leading period) either in the directory where the problematic script is, or in the web document root directory if you want it to affect all scripts on your site. Add the following line to it:
<i>
</i>php_value allow_call_time_pass_reference on
Copy linkTweet thisAlerts:
@KrizaauthorOct 01.2006 — thanks dude, i made the .htaccess file and it worked!
Copy linkTweet thisAlerts:
@NogDogOct 01.2006 — thanks dude, i made the .htaccess file and it worked![/QUOTE]
w00t!

?
Copy linkTweet thisAlerts:
@adizlajaOct 10.2006 — thanks guys, i figured out the problem, i was putting the wrong DIR .


[/QUOTE]


How exactly did you fix your URL? I tried everything but the error still keeps coming up. Thanks
×

Success!

Help @Kriza 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 4.28,
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,
)...