Loading ...
Sorry, an error occurred while loading the content.

6175Need help - No such file or directory: exec of '/opt/lampp/cgi-bin/lights.cgi'

Expand Messages
  • erabelas
    Jul 13, 2008
      I have a server and client scripts called lights.pl and lights.cgi.
      This script controls my X10 lamps using the Device and ControlX10 perl
      modules. I can't run this successfully on my Ubuntu with the latest
      SOAP-Lite-0.710.07 version as well as the version 0.69 which is the
      available version in Ubuntu. But it runs in Windows with SOAP-Lite
      version 0.55-r1.

      The error is always like this, I copied it from the error.log from apahce.

      [Sun Jul 13 22:00:23 2008] [error] [client] (2)No such
      file or directory: exec of '/opt/lampp/cgi-bin/lights.cgi' failed
      [Sun Jul 13 22:00:23 2008] [error] [client] Premature end
      of script headers: lights.cgi
      [Sun Jul 13 22:00:23 2008] [error] [client] [Sun Jul 13
      22:00:23 2008] lights.pl: 500 Internal Server Error at
      /opt/lampp/cgi-bin/lights.pl line 13

      lights.pl script is like this,

      #!/usr/bin/perl -w
      use CGI::Carp qw(fatalsToBrowser);
      use SOAP::Lite;
      use CGI ':standard';

      #Turn on Lights
      $unit = param('unit');
      $onoff = param('onoff');


      sub turn_lights_soap {
      $soap_response = SOAP::Lite ## this is line 13
      -> uri('')
      -> proxy('')
      -> turn_lights ($unit,$onoff);

      my $res = $soap_response->result;
      print "Content-type: text/html\n\n";
      print "$res\n";

      lights.cgi is like this,

      #!usr/bin/perl -w

      use SOAP::Transport::HTTP;

      -> dispatch_to('Lights')
      -> handle;

      package Lights;

      sub turn_lights {

      use Device::SerialPort;
      use ControlX10::CM11;

      my ($class, $unit, $onoff) = @_;

      my $HOUSE_CODE = "A";

      my %UNIT_CODE = (
      "living_lamp" => "1",
      "bed_lamp" => "2",
      "study_lamp" => "3",
      "fan" => "4",

      my %cmds = (
      "on" => "J",
      "off" => "K",

      my $serial = Device::SerialPort->new('/dev/ttys0', undef );
      # $serial->error_msg(1); # use built-in error messages
      # $serial->write_settings || die "Could not set up port\n";

      # Adress unit
      ControlX10::CM11::send( $serial, $HOUSE_CODE . $UNIT_CODE{$unit} );
      # Send command
      ControlX10::CM11::send( $serial, $HOUSE_CODE . $cmds{$onoff} );

      return "$unit $onoff";


      EVEN the sample hibye.cgi and hibye.pl scripts, it will not run, the
      error is,
      [Sun Jul 13 21:57:11 2008] [error] [client] Premature end
      of script headers: hibye.pl

      Any help is greatly appreciated,

    • Show all 2 messages in this topic