Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6625545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:47:15+00:00 2026-05-25T21:47:15+00:00

I am getting the following response in ssh when trying to run this php

  • 0

I am getting the following response in ssh when trying to run this php script… it worked fine under php 5.2 and now with 5.3 installed I am running into trouble. I cannot see what is wrong.

The errors :

line 1: ?php: No such file or directory

line 2: syntax error near unexpected token `0′

line 2: `set_time_limit(0) ;’

Here is the script.

<?php
set_time_limit(0) ;

$arr = explode("/",$_SERVER['SCRIPT_FILENAME']);
$ct = count($arr);
unset($arr[$ct-1]);
$path=implode("/",$arr);
$path=$path."/";

if(is_file($path."state.txt"))
 {  
    $lines = file($path."state.txt");

    if($lines)
        {
        foreach($lines as $line) 
          {
            if($line)
              {
                 $state = trim($line);
                 if(!is_dir($path.$state)) 
                  {
                    @mkdir($path.$state,0777);
                    if(is_file($path."copieble/state/index.php"))
                       { 
                          $from = $path."copieble/state/index.php";
                          $to = $path.$state."/index.php";
                          @copy($from,$to);
                       }
                  }
              }
          }
        } 
}

 @chdir($path);
           $handle=opendir('.');
               while (($file = readdir($handle))!==false) 
                   {
                     @chdir($path);
                     if (($file != ".") && ($file != ".."))
                         { 
                           if(is_dir($file) && $file != "copieble" && $file !="_vti_cnf")
                               {
                               if(is_file($path.$file.".txt"))
                                 { 
                                 $lines = file($path.$file.".txt");
                                       if($lines)
                                            {
                                            foreach($lines as $line) 
                                              {
                                                if($line)
                                                  {
                                                     $city = trim($line);
                                                     @chdir($path.$file);
                                                     if(!is_dir($city)) 
                                                        {

                                                            @mkdir($city,0777);
                                                        if(is_file($path."copieble/city/index.php"))
                                                           { 
                                                             $from = $path."copieble/city/index.php";
                                                             $to = $path.$file."/".$city."/index.php";
                                                             @copy($from,$to);

                                                           } 
                                                    }

                                                  }
                                              }
                                            } 
                                 }

                              }

                        }
                  }
                 closedir($handle); 
include("reflect_changes.php");
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:47:16+00:00Added an answer on May 25, 2026 at 9:47 pm

    I’m guessing that you’re running it like this:

    ./my_script.php
    

    Try running it like this:

    php my_script.php
    

    The reason the first would error is that when you try to run it like an executable, the shell first looks to see if there’s a hashbang. If so, it runs it with that interpreter. If not (like in your case), it tries to run it as an executable. That, too, fails, so it resorts to trying to execute it as a shell script.

    <?php in a shell script would try to start reading from a file called ?php and pipe that into a command that follows, but there’s no file called ?php to read from. Thus, it errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I run a print_r command on $_POST and I am getting the following response:
I am getting following error when I am trying to get WebResponse using WebResponse
I am getting Following Exception while configuring the Connection Pool in Tomcat This is
When am trying to set default date and default sysdate am getting following errors:
Am trying to insert XML into XML Column.. getting following error: . Msg 6819,
I'm submitting a command to a ssh session and getting an XML response back
I'm getting the following json response for one of my android service server response,im
I am getting the following error when i run my .aspx page. Error Code0x8007000d
I am getting the following response after executing the code shown below the response.
Getting following error message when I try to fetch JSON response into my app.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.