[SOLVED] SB App no longer runs after upgrade from PHP 7.x. to 8.1.x

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kurzer
Posts: 94
Joined: Mon May 26, 2014 9:33 am

[SOLVED] SB App no longer runs after upgrade from PHP 7.x. to 8.1.x

Post by Kurzer »

Hi,
I had to restart an old project that I created with Spider, PHP and HTML.

After an update from PHP 7.x to PHP 8.1.x at the web host, the HTTPRequest calls apparently no longer work. I am supposed to fix this now.
Well, I see the error shown in the screenshot in the browser console: Uncaught TypeError: a.charAt is not a function.

Image

I have also used a HTTP-Request() derivative published by Kiffi, which returns more information.

Here I get the following back in the HTTPRequest callback:
{“readyState”:0, “status”:0, “statusText”: “error”}

Does anyone have an idea where I need to look here to fix the problem? I don't have much experience in JS and would appreciate any helpful tips.
Last edited by Kurzer on Sat Jan 25, 2025 9:46 pm, edited 1 time in total.
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
User avatar
Kurzer
Posts: 94
Joined: Mon May 26, 2014 9:33 am

Re: SB App no longer runs after upgrade from PHP 7.x. to 8.1.x

Post by Kurzer »

Okay, I'm getting closer, but it's behaving extremely strangely (at least for someone who doesn't know much about web servers, Linux, etc.).
Fact is: Only the PHP version has been changed on the web server. The app had been running perfectly until then.

And now it looks like the VAL() function of SpiderBasic simply runs into an error. I have narrowed this down with debug lines - see screenshot.

Image

We are here in a callback procedure that processes data from an HTTP request.
How can it be that the VAL() function suddenly runs on an error? In debug line “5” you can see that the result set contains a valid user ID (1005).
Even the use of an intermediate variable (sTemp) does not help to solve the problem.

I have now run this SB app once on a local xampp server with PHP 8.1. The error does not occur there.
How can that be? I would be very grateful for any ideas because I can't see a solution to this problem at the moment.

Many thanks in advance
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
User avatar
Kurzer
Posts: 94
Joined: Mon May 26, 2014 9:33 am

Re: SB App no longer runs after upgrade from PHP 7.x. to 8.1.x

Post by Kurzer »

I have found a workaround!

Workaround: I prefixed the parameter of all VAL() calls with “ ” +. Apparently otherwise JS does not recognize that it is a string type.

Before:

Code: Select all

stApplication\stCurrentUser\iUserID = Val(\lsResultset()\mpResultrow("users_id"))
After:

Code: Select all

stApplication\stCurrentUser\iUserID = Val(" " + \lsResultset()\mpResultrow("users_id"))
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: [SOLVED] SB App no longer runs after upgrade from PHP 7.x. to 8.1.x

Post by Fred »

That's very wierd. Do you have more internal info why it failed ? is it PHP side ?
User avatar
Kurzer
Posts: 94
Joined: Mon May 26, 2014 9:33 am

Re: [SOLVED] SB App no longer runs after upgrade from PHP 7.x. to 8.1.x

Post by Kurzer »

Hello Fred,

I'm not familiar enough with network technology, Linux servers and especially JS to investigate this error in detail.

I have to say that this is not a web server that I administer, but one that I have rented and that I can only configure to a limited extent.

What exactly do you mean by “is it PHP side”?

The JS code generated by Spiderbasic runs on the client, i.e. directly in the user's browser. Therefore, it is also confusing to me why upgrading the PHP version on the server led to this problem. Previously PHP 7.3. was installed, now it is PHP 8.3.15 and boom the problem with VAL() occurs. I have not changed anything else on the server.

Unfortunately I can't downgrade back to PHP 7.3 because the server provider now only supports PHP 8.x versions. The PHP 7.3 version was probably retained in the server provider's upgrades as a gesture of goodwill. Normally you have to go along with these upgrades.

But the irritating thing is that the SpiderBasic compilation runs without errors on my locally installed test server (XAMPP server), although an 8 version of PHP is also installed there.

Since I can configure the server on which the problem occurs within certain limits (via Plesk), I may be able to provide you with more information. You would just have to tell me what exactly you want to know.
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
Post Reply