Results 1 to 5 of 5

Thread: File not found

  1. #1
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1

    Unanswered: File not found

    I have a php script that runs fine on SCO 6.0.0 with Apache 1.3.37 and PHP version 5.2.3, but on SCO 5.0.7 with Apache 1.3.36 and PHP version 4.4.2
    I get a file not found message whenever I try to execute the following.




    output of /tmp/r5.log

    /usr/lib/apache/htdocs/content/en
    total 502
    -rwxr-xr-x 1 root sys 298 Mar 11 09:41 r5
    -rwxr-xr-x 1 root sys 298 Mar 10 16:42 r5.ksh
    *************************************************
    PHP Script

    <?php
    session_start();
    include_once("../includes/header.php") ;
    ?>
    <!-- CONTENT GOES AFTER THIS POINT -->
    <?php
    <!-- lines skipped -->
    `pwd >/tmp/r5.log`;
    `ls -l /usr/lib/apache/htdocs/content/en >>/tmp/r5.log`;

    $output=`/u/web/ksh/r5.ksh $UNIQ $uniq $SORTORDER $DIRECTION NAME="$NAME"`;

    <!-- $output=`./r5.ksh $UNIQ $uniq $SORTORDER $DIRECTION NAME="$NAME" REF= -->
    <!-- $output=`./r5 $UNIQ $uniq $SORTORDER $DIRECTION NAME="$NAME" REF="$REF"`; ->
    echo $output;

    ?>
    <!-- ******************************** -->

    *******************************
    apache error_log - various versions of output=`.......

    sh: ./r5.ksh: not found
    sh: r5.ksh: not found
    sh: /usr/lib/apache/htdocs/content/en/r5.ksh: not found
    sh: content/en/r5.ksh: not found
    sh: r5.ksh: not found
    sh: ./r5: not found
    sh: /u/web/ksh/r5.ksh: not found
    ~
    Last edited by kitaman; 03-11-10 at 14:42.

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    I'm just guessing here:

    You give us the file permissions for /usr/lib/apache/htdocs/content/en where it shows k5.ksh but the directory you seem to be trying to run the program in is /u/web/ksh/r5.ksh. Do you have permission to run things here?

    As an aside is it wise to have 2 variables called uniq (uniq and UNIQ).

  3. #3
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Quote Originally Posted by mike_bike_kite View Post
    I'm just guessing here:

    You give us the file permissions for /usr/lib/apache/htdocs/content/en where it shows k5.ksh but the directory you seem to be trying to run the program in is /u/web/ksh/r5.ksh. Do you have permission to run things here?

    As an aside is it wise to have 2 variables called uniq (uniq and UNIQ).
    I have tried various versions of this line of code, and none seem to work, I am able to read /u/web/ksh.
    The commented lines are other attempts.

    The rel 6.0 version has r5.ksh in content/en, and is accessed as ./r5.ksh.

    UNIQ and uniq are different, the variables are case sensitive.

  4. #4
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Still just guessing:

    Quote Originally Posted by kiteman
    I have tried various versions of this line of code, and none seem to work, I am able to read /u/web/ksh.
    This doesn't guarantee the apache can read the file though. Can you show us the permissions on the file you want to run /u/web/ksh/r5.ksh? Does the apache user have permission to read that directory and that file? Something like:
    Code:
    echo `ls /u/web/ksh`;
    echo `head /u/web/ksh/r5.ksh`;
    If that works then it might be worth seeing if the apache user can run a noddy ksh script just to check the set up of apache.
    Quote Originally Posted by kiteman
    UNIQ and uniq are different, the variables are case sensitive.
    I guess if it looks confusing to me now then it will look confusing to you in 6 months time

  5. #5
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Fixed, after 4 hours.
    This line works:

    $output=`ksh ./r5.ksh $UNIQ............`;

    Thanks,

    Jack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •