Any programmers familiar with PHP?

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

qquake2k

Captain Low-N-Slow
Joined
Jan 26, 2010
Messages
13,574
Reaction score
65
We have some custom programs at work, that were written for us in PHP over 10 years ago. The main program converts an Excel spreadsheet into an online orderform. The utility program fixes some things in the resultant PHP file. But a few months ago, the utility program started giving me the "List index out of bounds" error. It's driving me crazy. Since it's been so long, we can't get support for it. They're on their way out, but we still have to use them on a limited basis. Does anyone have any ideas what could cause this error?

list_index_error.jpg
 
No, it takes the data from the Excel spreadsheet. It gives the error no matter how large or small the spreadsheet is.
 
Being 10 years old, it likely isn't written to handle large data volumes.

So, it may be barfing because of that.

There was a time when Excel spreadsheets were limited to 65536 rows.

-Kevin
 
The biggest spreadsheet I use is less than 1300 rows. And like I said, it was working fine a few months ago. The main program works fine, it's just the utility that's giving me the error.
 
Is the part of the program written in VBA?

Something changed in the environment to cause it, since typically they don't go bad on their own. You have to do some detective work to find out "whodunit". Did you switch versions of Excel or the OS? Possibly a .dll update?

Greg
 
Last edited:
Is the part of the program written in VBA?

Something changed in the environment to cause it, since typically they don't go bad on their own. You have to do some detective work to find out "whodunit". Did you switch versions of Excel or the OS? Possibly a .dll update?

Greg

I have no idea about VBA. I'd post the program here, but it's an exe. This all happened when something major happened to my old PC that I never could figure out. It started doing it on my old PC, and continues to do it on my new PC. I believe I've got an original copy of the utility in a zip file.
 
I have no idea about VBA. I'd post the program here, but it's an exe. This all happened when something major happened to my old PC that I never could figure out. It started doing it on my old PC, and continues to do it on my new PC. I believe I've got an original copy of the utility in a zip file.

Likely a compatibility issue. Try running it in XP compatibility mode, or better yet on a virtual machine with XP installed.

Without source code, it's going to be tough. Since it's an EXE, PHP isn't germane to the discussion.

-Kevin
 
Gripping at straws here, but you might try using the "Save As" option in Excel and try saving the spreadsheet in the Excel 97-2003 Workbook format if it is available. It may be that the program can't handle a newer format file.

-- Roger
 
Gripping at straws here, but you might try using the "Save As" option in Excel and try saving the spreadsheet in the Excel 97-2003 Workbook format if it is available. It may be that the program can't handle a newer format file.

-- Roger

Yeah, I already have to do that for the main program.
 
Depending on the complexity/effort, instead of trying to figure what out what broke the opaque .exe it might be easier to look at the PHP generated, figure out what needs to be fixed up in it, and make a new script to do the fixups (hoping I'm correct in inferring that you have the intermediate output in PHP form). Then you could regain control of the process...
 
At this point, I'm not sure it would be worth it. Like I said, it's on its way out. I certainly couldn't write a script, so we'd have to pay someone to do it.
 
At this point you may have to accelerate its demise...code rot is aggravating for sure.
 
So what changed in the last couple of months? Did you upgrade something? Do you have a backup of the site when it still worked?
 
So what changed in the last couple of months? Did you upgrade something? Do you have a backup of the site when it still worked?

Apparently my old PC either lost or corrupted my user profile. It lost ALL of my settings. Desktop image, screensaver, Outlook and Thunderbird settings, everything. I tried redoing everything, but it still wasn't right. Weird things like folder settings, etc., would always revert to the default. So I finally got a new PC, but the Windows transfer utility wouldn't run on the old PC. So I had to transfer everything manually. The new PC is working fine, but I get the error on the PHP utility.
 
Likely a compatibility issue. Try running it in XP compatibility mode, or better yet on a virtual machine with XP installed.

Without source code, it's going to be tough. Since it's an EXE, PHP isn't germane to the discussion.

-Kevin

I never really thought about it, but I guess you're right. It produces files in PHP. I have no idea what language the programs are written in.
 
I'm wondering if there is a required process not running on the new system. I assume someone else set up the old system. Do you have any idea whether there is a database involved in your set up? When you edit the excel file for whatever reason, do you need to run some other program in order to update the website?
 
That error (List index out of bounds) might be due to accessing a column or row beyond the actual data; just a guess.
 
Considering what happened to the system it may also be a wrong error being reported due to a DLL that's missing.

-Kevin
 
I'm wondering if there is a required process not running on the new system. I assume someone else set up the old system. Do you have any idea whether there is a database involved in your set up? When you edit the excel file for whatever reason, do you need to run some other program in order to update the website?

No, there is no database. The program creates the PHP file from the Excel spreadsheet, which is then uploaded to a web server.

That error (List index out of bounds) might be due to accessing a column or row beyond the actual data; just a guess.

A column or row in the Excel spreadsheet?

It is also an error reported from a failed database query.

Like I said, there is no database, so I don't think it queries anything.

Considering what happened to the system it may also be a wrong error being reported due to a DLL that's missing.

-Kevin

That very well could be. The old PC was pretty jacked up. But I have no idea how to find out or replace a DLL.

Or it could be a difference in the output path... like the path (output directory name) was hard coded, and that path doesn't exist on the new system...

Well, as far as I know, the output path is the same directory as the PHP file is written to. If I remember correctly, the utility would create a new PHP file in addition to the original. One of the things the utility does is change the name of the extension from .php3 to .php. At the time, the web server wouldn't recognize .php3 files, for some reason. It also changes the math in the PHP file. Without the utility, when it creates an order, it doesn't list individual prices, just the extended prices.
 
Here are the results with and without the utility:

Following are the contents of the order:
Section 1 - Airway Management and Suction
22 each AA01 Berman Airway, 40mm, Pink - $0.23 (ea) - $5.06
1 each AA03 Berman Airway, 80mm, Green - $0.23 (ea) - $0.23
44 each AA05 Berman Airway, 100mm, Lavender - $0.23 (ea) - $10.12

Order Total: $15.41

Following are the contents of the order:
Section 1 - Airway Management and Suction
22 each AA14 Guedel Airway, 40mm, Pink - $11.44
1 each AA16 Guedel Airway, 60mm, Black - $0.52
44 each AA18 Guedel Airway, 80mm Green - $22.88

Order Total: $34.84
 
If its written in C, can you debug the program, maybe there is an error in there somehow, that might be a place to start? i could be wrong as I only have a couple programming classes under my belt. Or i think for PHP, it may have its own debugger?
 
If its written in C, can you debug the program, maybe there is an error in there somehow, that might be a place to start? i could be wrong as I only have a couple programming classes under my belt. Or i think for PHP, it may have its own debugger?

Unfortunately, I have no idea what language it's programmed in.
 
Back
Top