XFileSharing Free - Pleas help neww install problem:probably wrong php.ini ???

Free version of Xfilesharing

Moderator: admin

Message
Author
pav55
Posts: 2
Joined: Aug 30, 2011 2:32 pm

Pleas help neww install problem:probably wrong php.ini ???

#1 Postby pav55 » Aug 30, 2011 2:38 pm

#!/usr/bin/perl use strict; use CGI::Carp qw(fatalsToBrowser); use lib '.'; use DBI; use XFileConfig; use Process; use CGI qw(param); my $ok = "
OK"; my $ses = Process->new; my $f = $ses->f; if($f->{save_sql_settings} || $f->{site_settings}) { my @fields = $f->{save_sql_settings} ? qw(db_host db_login db_passwd db_name) : qw(site_url site_cgi site_path temp_dir target_dir admin_password); my $conf; open(F,"XFileConfig.pm")||$ses->message("Can't read XFileConfig"); $conf.=$_ while ; close F; for my $x (@fields) { my $val = $f->{$x}; $conf=~s/$x\s*=>\s*(\S+)\s*,/"$x => '$val',"/e; } open(F,">XFileConfig.pm")||$ses->message("Can't write XFileConfig"); print F $conf; close F; $ses->redirect('install.cgi'); } if($f->{create_sql}) { my $db = $ses->db; open(FILE,"install.sql")||$ses->message("Can't open create.sql"); my $sql; $sql.=$_ while ; $sql=~s/CREATE TABLE/CREATE TABLE IF NOT EXISTS/gis; $db->Exec($_) for split(';',$sql); $ses->redirect('install.cgi'); } print"Content-type:text/html\n\n"; print"
XFileSharing Installation Script
"; print"1) Permissions Check

"; my $perms = { 'logs.txt' => 0777, 'upload.cgi' => 0755, 'upload_status.cgi' => 0755, 'index.cgi' => 0755, 'temp' => 0777, 'uploads' => 0777, 'XFileConfig.pm' => 0777, }; my @arr; for(keys %{$perms}) { chmod $perms->{$_}, $_; my $chmod = (stat($_))[2] & 07777; my $chmod_txt = sprintf("%04o", $chmod); push @arr, "$_ : $chmod_txt : ".( $chmod == $perms->{$_} ? 'OK' : "ERROR: should be ".sprintf("%04o",$perms->{$_})."" ); } chmod 0777, "$c->{site_path}/captchas" if -d "$c->{site_path}/captchas"; print join '
', @arr; if( grep{/ERROR/}@arr ) { print"

Fix errors above and refresh this page"; } else { print"

All permissions are correct.$ok"; } print""; print"2) MySQL Settings

"; my $dbh=DBI->connect("DBI:mysql:database=$c->{db_name};host=$c->{db_host}",$c->{db_login},$c->{db_passwd}) if $c->{db_name} && $c->{db_host}; if($dbh) { print"MySQL Settings are correct. Can connect to DB.$ok"; } else { print<
MySQL Host:

MySQL DB Username:

MySQL DB Password:

MySQL DB Name:


EOP ; } print""; print"3) MySQL tables create

"; if(!$dbh) { print"Fix MySQL settings above first."; } else { my $sth=$dbh->prepare("DESC Files"); my $rc=$sth->execute(); if($rc) { print"Tables created successfully.$ok"; } else { print< EOP ; } } print"4) Site Initial Settings

"; if($c->{site_url} && $c->{site_cgi} && -d $c->{site_path} && -d $c->{temp_dir} && -d $c->{target_dir} && $c->{admin_password}) { print"Settings are correct.$ok"; } else { my $path = $ENV{DOCUMENT_ROOT}; my $url = 'http://'.$ENV{HTTP_HOST}.$ENV{REQUEST_URI}; $url=~s/\/[^\/]+$//; my $url_cgi = $url; $url=~s/cgi-bin\///; $url = $c->{site_url}||$url; $url_cgi = $c->{site_cgi}||$url_cgi; my $site_path = $c->{site_path}||$path; my $temp_path = $c->{temp_dir}||$path.'temp'; my $upload_path = $c->{target_dir}||$path.'uploads'; print< htdocs folder URL:
No trailing slash
cgi-bin folder URL:
No trailing slash
htdocs path:

temp folder path:

uploads folder path:

Admin password:


EOP ; } print"5) Manually Remove install files

install.cgi
install.sql
convert.cgi";

admin
Site Admin
Posts: 1801
Joined: Mar 22, 2006 12:32 pm

#2 Postby admin » Aug 31, 2011 7:25 am

Looks like your server doesnt have perl support. So, instead of executing, it's showing file contents.


Return to “XFileSharing Free”

Who is online

Users browsing this forum: No registered users and 0 guests