Uninitialized line offset error from PHP import script

I have an import-from-excel script as part of a CMS that previously ran without problems.

Recently, my hosting provider updated its infrastructure, including PHP from 5.1 to 5.2.6, and the script now returns "Uninitialized line offset: -XXX in /path/scriptname.php on line 27" (XXX as a decreasing number from 512 and / path /scriptname.php, of course, the full path to the script).

It returns this error for each line of the excel file. Line 27 is simply a return from the function, which is the first point at which the imported data is processed:

function GetInt4d($data, $pos) { return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24); } 

He finally hacked with "Fatal error: 47185920 bytes allowed, exhausted (tried to allocate 71 bytes) in /path/scriptname.php on line 133."

There is nothing useful in Apache error logs. I'm at a dead end. Does anyone have any ideas, at least where to look? Even knowing if this could be something in my script or something to do with the update would be helpful. I had another problem with another site on the same provider, which (after updating) could not write sessions to the tmp directory (after permission), but I am sure that it is not (?).

EDIT: As it turned out, the answer was that the analyzer version is incompatible in some way with PHP 5.2.6, I thought it might be useful to someone that the Excel Pader table parser in question.

+4
source share
3 answers

Uninitialized line offset:

... means $data not an array.

+2
source

Thanks for the input, the situation "resolved itself" through me, finding a newer version of the parsing library that I used. My guess is that the problem is related to the difference between the versions of PHP, although I'm not sure what exactly. Fixed but frustrating.

EDITOR: I am going to accept to answer solely in the interest of closing the question. Thanks again for input.

+1
source

Source: https://habr.com/ru/post/1277591/


All Articles