Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EasyPopulate - worked on dev (win), not on prod (linux)


shred21

Recommended Posts

Posted

Hi all,

 

Well, I'm this close to finishing this website. Last task is to get EP to work.

 

It worked fine under win2kserver (development environment) but now that

it's on the remote production box (linux), it fails...

 

It seems to be failing right on the UPLOAD AND SPLIT FILE section.

There are no error messages to mention. Debugging (echos) indicate that it is NOT getting into the loop that begins with:

 

if (is_uploaded_file($usrfl) && $split==1) {

 

 

ANY HELP at all would be greatly valued and deeply appreciated!

 

Thanks,

 

--ted

Posted

You might want to check if your host has file uploading turned on in php.ini. If not, Easy Populate won't work the normal way. I think that you might be able to use FTP to upload it to a temp directory on the server and use EP to load the temp file into the database. However, I haven't done it myself.

 

Good luck,

Matt

Posted

Thanks for the reply, Matt.

 

The file upload DOES work, however. I can see the file on the server exactly where it's supposed to be.

 

Both temp dirs are correctly configured and the permissions are correct. It just doesn't go thru the insert or update loops...

 

I've set debugging comments thru the scripts and it just seems to NOT go into the second call to is_uploaded_file($usrfl). The first call (around line 690) works fine.

 

Perhaps something is not being "reset" properly...? I dunno......

Anyway, thank you again for your input.

 

--ted

Posted

Try making the following entry in your admin/.htaccess file to see if it does not provide a little more info on the problem.

php_flag display_errors on

After you try to run EP, if you do not get any errors displaying remove that entry from your .htaccess.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

I didn't have an .htaccess file in the root of my admin dir, so I copied the one from the root of the catalog to that dir, commented everything else out (something about SSL and defining the agent) and made the entry you selected there.

 

Nothing different was output....

 

Was there more to that line of code?

 

And thanks for the reply! :-)

Posted

No, you can safely delete that .htaccess file now.

 

The line that I had you enter simply prints out any error messages that are normally hidden by the system. The reason why you do not want those displayed is because they give away sensitive information about your system that could be used to hack it. ;)

 

You are setting EP to split the file correct?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

Actually, no. I'm using the first form (Upload EP File), altho I did try the "Split EP File" form as well, with the same result. I've got a small set of records (~60) which worked like a champ the other day on my Win2k Server (yeah, I know... famous last words!! :-) )

 

It HAS to be something simple...

 

In the section where the file is read (around line 740) where the file is read into variable $newreaded, I have a print statement that outputs the next 'chunk' (print "read: ".$read."<br>").

 

All 60-odd rows of the csv file are output. After that, nothing happens...

 

What SHOULD happen there - shouldn't it insert "|" between each field value and then simply import each record?

Posted

Check your file around record 60 then and see if something is not missing (like the EOR indicator) or if some kind of extraneous character is present.

 

Try to determine the last record that is read. The following record will be your troublemaker. ;)

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

OH!! so close..........

 

The last record is fine, but that got me thinking that I did make some changes to the structure of the template file (and underlying Products table) since the other day, so I checked the structure of the import template against the queries in EP and they match up...

 

There has to be something in the way the logic is now being invoked.

Posted

The logic will be the same regardless of the OS the script is running on.

 

The items that are affected by the underlying OS are the results of functions.

 

There has to be something blocking the reading of the last records either script-wise or data-wise.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

That's what I thought (about the logic). I re-saved the CSV file in case there was something wrong with the last record, but it still gets up to the point where the records are read into the "$newreaded" variable and then execution either stops or goes somewhere I can't readily discern...

 

Any idea where the script should go once the $newreaded variable is populated?

Posted

Once newreaded is populated, the EOR indicator is removed and the results are stored in $readed.

 

This occurs around line 735 in my easypopulate.php file (v2.60).

 

Setup some debugging statements after and see what happens.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

OK, so maybe newreaded is not getting populated... from around line 740, I have the following:

	$newreaded = "";

foreach ($readed as $read){

 print "read: ".$read."<br>";

 $newreaded .= $read;

}



print "count: ".count($newreaded)."<br>";



for ($i =0; $i < count($newreaded); $i++) {

 print "i: ".$i." - '".$newreaded[$i]."'<br>";

}

 

which outputs the following:

 

 read: v_products_model,v_products_image,v_products_name_1, ..... EOREOR

 read: "field_value_1", field_value_2, field_value_3, ... field_value_n, ... EOREOR

 read: "field_value_1", field_value_2, field_value_3, ... field_value_n, ... EOREOR

 read: "field_value_1", field_value_2, field_value_3, ... field_value_n, ... EOREOR

 

(ALL ROWS IN TABLE ARE DISPLAYED. FIRST VALUE IS QUOTED.)

 

Followed by:

 

 count: 1

  i: 0 - 'v'

 

Maybe the quotes around the first field value are screwing this up? But I didn't change anything in the file format to cause this to happen...

Posted

GOT IT!

 

Made the mistake of saving the file as a .CSV.......

 

once it was .TXT format I was able to roll back to my code from the other day and WHAMMO! it worked. :oops:

 

 

Thank you all for your help! Now it's time to play with the kids!!

 

--ted

Posted

Glad to hear that you got it working!

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Posted

Thanks again for your help!

 

Of course, it says right in the docs about .CSV files, but some things are learned the hard way...

 

--ted

Posted
Thanks again for your help!  

 

Of course, it says right in the docs about .CSV files, but some things are learned the hard way...

 

--ted

Yeah, but I'll bet you'll never repeat this again! ;) :lol:

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...