Internal Server Error

From Relay

Jump to: navigation, search

The cause of this error is Apache not knowing how to interpret the file. In some cases upload.pl, but you might be experiencing a PHP security issue.

[edit] Error Message During Install

Verifying Perl Installation... for the upload script @ http://ecosmear.com/relay/demo/upload.pl?test ...

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /relay/install/index.php on line 381

Warning: file_get_contents(/relay/upload.pl?test) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /relay/install/index.php on line 381

the upload.pl script seems to be having problems, you may need to change the 1st line to reflect the path to your perl installation, or in iis map the .pl extension to the perl executable. You may need to enable mod_cgi for .pl files

[edit] Solution

Try each of these soultions and try running the install script again after each one.

  • download the latest version at least b01-063006 and replace the upload.pl file, we used a different line break
  • if you are running *nix, make sure that your web server (apache/lighttpd/etc.) has permissions to write to the relay directory.
  • change the 1st line of the script to reflect your perl path something like #!/usr/bin/perl
  • chmod 755 upload.pl
  • check what the actual error is by executing it in the command line "perl upload.pl", the script should return nothing if it is working properly
output looks like this
Can't locate conf.uploader in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at upload.pl line 8.

SOLUTION ?

  • in .htaccess in the relay root directory, add "AllowOverride All" without the quotes at the bottom of the file
  • if it still doesn't work send us your error log if you have access, or post here.
  • isn't "URL file-access is disabled in the server configuration" usually because allow_url_fopen is turned off at the host?
    • ini_set('allow_url_fopen', 'on'); might help on older phps.
    • using CURL might help on some hosts. this fixed install problems for me (see below) and the dreamhost wiki for other examples. Theres a guide for dreamhost users here
      • perhaps relay should automatically detect for file_get_contents, then curl, and display "php security must be fixed before perl script can be used _here are some suggestions_, disabling for now." on failure of both?
    • URL file access should probably not be used, or not blow up with failure, because i think this is very common. file_get_contents(http://..) will not work on many hosts these days. is it necessary?


#  $response = file_get_contents($uploadPath);
  $ch = curl_init();
  $timeout = 5; // set to zero for no timeout
  curl_setopt ($ch, CURLOPT_URL, $uploadPath);
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  $response = curl_exec($ch);
  curl_close($ch);
  • this is really funky: if /relay/ is set to 755, permission is denied for the creation of conf.inc.php and upload.pl?test shows OK... if /relay/ is set to 777 the conf.inc.php creation is successful but upload.pl?test yields Internal Server Error.
    • upload.pl is set to 755 and the recommended addition to th httpd.conf file for executing the .pl in /relay/ as been inputted, and apache has been rebooted
    • when running perl upload.pl from shell, i see
Content-Type: text/plain
Any ideas?
  • Chmod relay/ to 777 and wait for first run of installation. This will help to create conf.inc.php
  • When error will appear, chmod relay/ to 755
  • Find the following code in install/index.php
if(file_exists("$rootpath/conf.inc.php")){
?>
<p class='warning'><strong>Warning</strong><br />
Configuration file already detected.  Delete conf.inc.php in Relay's root directory before running this script again.</p>
		<?php
		exit;
}
  • Then just delete the exit; command.
  • Refresh install/index.php and say "yes" to promt "Send form data to browser again"
  • The script will say conf.inc.php already exists, but it's OK and will continue to execute until test will be done.

When you run the perl upload.pl and get this string back..::: Content-Type: text/plain Make sure mod_perl is install in apache or it will not be able to run the file. --bannerd

Personal tools
support