sanskrit-lexicon / csl-websanlexicon

1 stars 1 forks source link

PHP 8.1 #26

Closed funderburkjim closed 1 year ago

funderburkjim commented 1 year ago

The webmaster of the sanskrit-lexicon at Cologne recently announced an upgrade to the PHP component of the server. PHP will be upgraded to version 8.1 (from the current 7.x). This upgrade is expected sometime after November 15, 2022.

The webmaster requested that we attempt to prepare the sanskrit-lexicon site for this change.

This note describes the steps I am taking in response to this request.

funderburkjim commented 1 year ago

local installation upgrade

My current local installation has been using XAMPP version 8.0.0 (so the PHP version is 8.0.0).

The current XAMPP version is 8.1.10.

I upgraded the local installation to this latest version of XAMPP.

Approximately, here are the details for upgrading the local installation

Here are the folders copied in my particular installation.
The cologne folder is the main folder. The other folders are for personal reference. Other local installations do not need all these folders.

funderburkjim commented 1 year ago

search displays for errors

I tried the various B/L/A/M displays, and also the simple-search display. A few small changes to some php modules were indicated by the presence in a display of php warning messages, or by a php warning message present in the browser error console.

Changes were made in the code in several repositories. The commit messages of these link to this issue.

funderburkjim commented 1 year ago

regenerate b/l/a/m

Since only the csl-websanlexicon component changed (in particular, csl-pywork did not change), I reran scripts:

Of course, I pushed the local changes to Github, then, on the Cologne server, pulled the repositories. The csl-apidev and csl-westergaard repositories have no initialization script to run.

funderburkjim commented 1 year ago

php messages handled

This might be useful for other times, so here are the messages seen from php, that were 'corrected away'

-------------------------------------------------------------------
Errors encountered:
-----------------------------------
1. webtc1/http://localhost/cologne/md/web/webtc1/index.php
Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in
C:\xampp\htdocs\cologne\md\web\webtc\getwordClass.php on line 148
---------------------------------
2. http://localhost/cologne/mw/web/webtc1/index.php
Warning: Array to string conversion in C:\xampp\htdocs\cologne\mw\web\webtc\basicadjust.php on line 247
line 247:   dbgprint($dbg,"ls_matchabbr: $data ->  $ansmax\n");
  Probably $data is an array.
  Solution: delete this debug line.
2a.  Make similar change to basicadjust of csl-apidev

---------------------------------
3. http://localhost/cologne/csl-westergaard/disp/index.php?section=28
Warning: Undefined array key "page" in C:\xampp\htdocs\cologne\csl-westergaard\disp\index.php on line 40

Also, removed warning errors (in browser console) from transcoder.php.

---------------------------------
4. http://localhost/cologne/simple/
dict=pwkvn, input=slp1
citation = sev  (sev is not a word in pwkvn)
Errors: Deprecated: round(): Passing null to parameter
Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is
deprecated in C:\xampp\htdocs\cologne\csl-apidev\dal.php

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in C:\xampp\htdocs\cologne\csl-apidev\listhierClass.php on line 372
also at line 339, 89, 92, 96, 98, 100,

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in C:\xampp\htdocs\cologne\csl-apidev\listhierClass.php on line 121
funderburkjim commented 1 year ago

Can you think of other likely spots where unexpected input might cause problems? please mention in a comment and I'll investigate.

funderburkjim commented 1 year ago

The Cologne version of php can be found by https://sanskrit-lexicon.uni-koeln.de/php/phpinfo.php.

gasyoun commented 1 year ago

a display of php warning messages, or by a php warning message present in the browser error console.

Thanks for these small things that make a big difference.

funderburkjim commented 1 year ago

sanskrit-lexicon server is now using php 8.1.12. See the phpinfo.php link above.