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 6243645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:10:43+00:00 2026-05-24T12:10:43+00:00

I have the following file which process a single XML file and pushes it

  • 0

I have the following file which process a single XML file and pushes it into the Database as a row. It works perfectly for single files.

Now i wanted to put ALL files in the directory like this into the database and hence wrote a script to go over the directory and push all the files in it one by one. And YES it did work, but it stopped after processing XX (variable) amount of files

I though may be something wrong with my XML file, so decided to just have SINGLE XML file (which was perfectly processed earlier) in the directory and just loop over it, inserting it hundreds of time, so that i could confirm its a problem with my files. But guess what happened?

After processing XX(variable) amount of files, the processing stops. In my below example, it stopped at 110 (counter val), 111, 99 etc after repeated attempts. Where it should have processed 1000 files.

<?php
include_once '../includeTop.php';

header ( 'Content-type: text/xml' );

echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$dir = "../../newHotelFiles";
$file = NULL;
$fileName = "noFileName";

$processed = 0;
util::writeToLog ( $dir . '/progressData.tmp', "Files processed: $processed" );
try {

    echo XMLInterface::openTag ( "start" );
    for($counter = 0; $counter < 1000; $counter ++) {
        $dirHandle = opendir ( '../../newHotelFiles' );
        while ( false !== ($file = readdir ( $dirHandle )) ) {
            //process my files codes

                $processed ++;
                util::writeToLog ( $dir . '/progressData.tmp', "Files processed: $processed" );


            }

        }

    //util::writeToLog($dir.'/progressData.tmp', "Done ".$counter);
    }
    echo XMLInterface::closeTag ( "start" );
    exit ();
} catch ( Exception $e ) {
    echo XMLInterface::failure ( "Error occured. Written to the log file - $file.log" );
    util::writeToLog ( "../../newHotelFiles/$fileName.log", ExceptionHandler::error_msg ( $e ) );
    exit ();
}

?>

What is the problem? Is it the script (which i doubt as it works when the for loop is not there) or is there any serverside limit i donot know about

  • 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-24T12:10:44+00:00Added an answer on May 24, 2026 at 12:10 pm

    there is a max execution time limit in php called set_time_limit(); (along others)

            set_time_limit(0); // sets to unlimited
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large XML file which in the middle contains the following: <ArticleName>Article
I have the following code which loads and html file into a webview -
I have the following in a .htaccess file redirect 301 /page.php http://domain.com/page Which works
I have the following file (above) which seems to be an Unix pipe alt
I have the following in a file which is sourced both by .bashrc and
I have a CSV file which has the following format: id,case1,case2,case3 Here is a
I have a txt file which contains data in the following format: X1 Y1
We have a binary file from which we have identified the following dates (as
I have the following code which reads in the follow file, append a \r\n
I have the following query in iSeries SQL which I output to a file.

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.