This topic is locked
[SOLVED]

Migration of the Development and Production Platform at PHP 8.1

8/18/2022 7:14:04 PM
PHPRunner Tips and Tricks
fhumanes author

I think we must keep our production platforms as updated as possible. I have decided to migrate everything to PHP 8.1 and in this article I explain how it has gone.

The reasons why we must keep the platforms as update as possible are:

img alt
https://kinsta.com/es/blog/puntos-de-referencia-php/#symfony-542
This is a benchmark of the different versions of PHP. I have taken the reference from Symfony because it is perhaps the most similar to the PHPRunner applications .

img alt
https://www.php.net/supported-versions.php
Regardless of the performance increase that the new versions of PHP have, we must consider the support for the product versions .

Change Tracking

07/24/2022

  • I must admit that Xlinesoft has done an excellent job on version 10.7, because the applications (if they are version 10.2 or higher) are very easily migrated to this version and practically everything is migrated without changes .
  • Remember to update the plugins you have downloaded. The ones on my website are updated for PHP 8.
  • All external JavaScript libraries have no impact on this change.
  • In some cases I have had to update the external libraries that I used, for example, the webservices
  • The most common error that I have corrected is that of naming array variables$valor = $values[id]; // OK in PHP 7.4 y KO inPHP 8.1
    $valor = $values['id']; // Always correct


08/11/2022

  • I'm done converting the examples. I think they are all.
  • No new things have come out to take into account.
  • I only have the Rest Full Api examples left , because it requires the Slim framework update and the programming changes are very big and I have to rebuild all the examples.

08/16/2022

. I have already finished the conversion of the ResFull Api Server application that with PHP 8.1, it is required to use Slim 4.0

At the moment, I am very happy to have done the update and I recommend it to all those who have your platforms with versions prior to PHP 7.4.

Phprunner 10.7 works very well in PHP 8.1 and from my point of view, you have to take advantage of the work done by XLINESOFT for the PHP 8.1 support

S
silvio 8/20/2022

thank you very much!

J
jackwood 8/20/2022

Hi fhumanes ,

Do you Install PHP with VS16 x64 Non Thread Safe Or VS16 x64 Thread Safe in windows OS?

fhumanes author 8/20/2022

Hello,

I always install the PHP with Thread Safe

Cheers,
fernando

J
jackwood 8/20/2022

I've tried both version PHP8.1 with Thread Safe and NTS, and PHP 7.4

PHP8.1 TS and NTS failed to load with Error like this.

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in D:\xampp\htdocs\sgl\connections\MySQLConnection.php:71 Stack trace: #0 D:\xampp\htdocs\sgl\connections\Connection.php(57): MySQLConnection->connect() #1 D:\xampp\htdocs\sgl\connections\MySQLConnection.php(20): Connection->construct() #2 D:\xampp\htdocs\sgl\connections\ConnectionManager.php(26): MySQLConnection->construct() #3 D:\xampp\htdocs\sgl\connections\ConnectionManager_base.php(95): ConnectionManager->getConnection() #4 D:\xampp\htdocs\sgl\connections\ConnectionManager_base.php(115): ConnectionManager_Base->byId() #5 D:\xampp\htdocs\sgl\include\appsettings.php(1332): ConnectionManager_Base->getDefault() #6 D:\xampp\htdocs\sgl\include\dbcommon.php(90): include('...') #7 D:\xampp\htdocs\sgl\menu.php(6): require_once('...') #8 {main} thrown in D:\xampp\htdocs\sgl\connections\MySQLConnection.php on line 71

I don't know what issue if I Install PHP8.1 manual from official Site,
But If Install From XAMPP Site https://downloadsapachefriends.global.ssl.fastly.net/8.1.6/xampp-windows-x64-8.1.6-0-VS16-installer.exe?from_af=true it works and can run the PHPRunner Code.

J
jackwood 8/21/2022

Hi, I'm still not confident if I user php 8.1 in production,
Here if i try import the data from excel

Fatal error: Array and string offset access syntax with curly braces is no longer supported in E:\xampp\htdocs\system\plugins\PHPExcel\Shared\ZipStreamWrapper.php on line 78

PHPExcel Plugin maybe has not support PHP8.1

fhumanes author 8/22/2022

Hi Jackwood,

I have done an Export and Import test project in Phprunner 10.7 and I have executed it with PHP 8.1, and everything has worked well for me.

Please facilitate in what circumstances there is the error that indicates that it occurs in your project.

Cheers,
fernando

C
ckranichDevClub member 10/3/2022

Hi jackwood, Hi fhumanes,

I now try to migrate to PHP 8 (XAMP 8.1.6) too (using still PHPrunner 10.7 as 10.8 does not start here and throws error about not beeing able to start embedded server(NodeJS?))
Strange enough, I can see YOUR BOTH OUTCOMES in a single application (created in tha old days with 10.2 and pulled up step by step to 10.7)

  • Some forms work OK
    -some forms throw errors (Fatal error: Uncaught mysqli_sql_exception: Table '{mydatabasename}.{mytablename}' doesn't exist in engine in E:\xampp.......\setup\connections\MySQLiConnection.php:157

This is very strange as I suppose that all tables are using the same connection and the bespoke table exists (as seen in phpMyAdmin)

Any ideas?

Kind Regards,

M.
C
ckranichDevClub member 10/4/2022

It might be that PHPrunner 10.8 uses any COM/DCOM features 10.7 did not use?
@Admin: is there anything added to the used requirements in 10.8?
(10.7 runs OK on my Laptop, 10.8 not; when testing around OPC I killed some DCOM features some time ago;
looks like I will have to reinstall the Windows (painful!)....)

Plan B (Against reinstall Windows): Moving PHPrunner development to VM:

  1. Low footprint (VMWare) VM: Win7 x64

  • PHPrunner doesn't run on this properly
  • Demanded IE >= 9; IE9 still no works.
  • Another js error disclosed that the Node.js server might run on Port 8085
    (@Admin, pls. add to the documentation that an unused Port 8085 is necessary)

  1. Higher Footprint (VMWare) VM: Win10, 4G

  • 10.8 seems to work.

Why all that hassle?
I have some customers who had a 'security audit' and force me to step up to PHP8.
And I must be sure that I can continue with actual and future versions of PHPrunner
in these projects...

Greetings,

M.
C
ckranichDevClub member 10/4/2022

SOLVED - Finally was able to get 10.8 running...

Was installation issue.

  • Reinstall, Uninstall, Reinstall did not work.


  • There was a 2nd 10.8 install on system (earlier try) in different folder; uninstalled / removed both / manually cleaned leftovers


  • Installed again (this time outside the 'Program Folder' (As I normally do for old legacy software) ... worked now.



Will report how the upgrade to PHP8 (which still caused issues with 10.7) worked under 10.8

Greetings

C
ckranichDevClub member 10/4/2022

Hi All,

Some Updates:
The error :Fatal error: Uncaught mysqli_sql_exception: Table 'xxxxx.yyyy' doesn't exist in engine in C:\xampp......
has nothing to do with PHPrunner!
=> Something happened to this table when migrating (copying) the mySQL data out of the old XAMP/mysql/data folder into the new XAMPP mysql data folder

=> you can verify that you cannot access the table in phpMyAdmin too!

1932 - Table 'xxxx.yyy' doesn't exist in engine and 'table busy in the table view of the database'

=> This caused that some views in PHPrunner worked, some other did not work (see previous postings from me)

Fix:
I noticed that (by accident) this table was InnoDB, while all other (added earlier to project) were myISAM.
Converted table in old XAMPP to myISAM, copied over from data folder to new XAMPP -> OK

fhumanes author 10/4/2022

Hello,

My explanation was exclusively the change of the PHP version to 8.1.x.

If we change Apache and/or MySQL, it is another problem, much more complex.

Cheers,
fernando

ffrinai 11/29/2022

I try a simple table with a field1,field2,field3 for attach (File/Image) in spreadsheet mode:
it works with Built-in web server of phprunner enterprise 10.8 build 39925
but with my web server xampp-windows-x64-8.1.6-0-VS16-installer the error is:
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in C:\sitiweb\webpriv\testphp8\classes\controls\FileField.php:57 Stack trace: #0 C:\sitiweb\webpriv\testphp8\classes\controls\Control.php(739): FileField->buildControl('[{"name":"files...', 7, 0, Array, Array, Array) #1 C:\sitiweb\webpriv\testphp8\classes\listpage.php(2092): EditControl->getControlMarkup(Array, Array) #2 C:\sitiweb\webpriv\testphp8\classes\listpage.php(2068): ListPage->getInlineEditControl('attfile', 5, Array) #3 C:\sitiweb\webpriv\testphp8\classes\listpage.php(1726): ListPage->proccessRecordValue(Array, '&key1=1', Array) #4 C:\sitiweb\webpriv\testphp8\classes\listpage.php(2310): ListPage->fillGridData() #5 C:\sitiweb\webpriv\testphp8\table01_list.php(154): ListPage->prepareForBuildPage() #6 {main} thrown in C:\sitiweb\webpriv\testphp8\classes\controls\FileField.php on line 57

the content of line of FileField.php 57 is
if(count($this->pageObject->keys) > 0)

searching online i found this solution for line 57
if( is_countable($this->pageObject->keys) && count($this->pageObject->keys) > 0)

i think this solution should be implemented inside the phprunner, what do you think?

//---- other unsatisfactory solutions

if i remove the field3 for attach (file/image) it works fine with no errors
if i remove the spreadsheet mode it works fine with no errors

i'm going out of order !
Fabio

fhumanes author 12/3/2022

Hi @ffrinai.

I indicate the proof I have not done it.

Faced with these problems and since you are working on the latest Phprunner build, I suggest you report these problems to XLINESOFT. There are many possibilities in the product and it is, in my opinion, relatively easy, that something that is not compatible with PHP 8.1.X.

Cheers,
fernando

ffrinai 12/20/2022

Xlinesoft fix the problem.
They 'll include the FileField.php fix into the next update of PHPRunner.
Ceers,
fabio

fhumanes author 12/20/2022

Thank you very much for your message