CodeIgniter Forums
Codeigniter 3.2.0 problem with php 8.2 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Codeigniter 3.2.0 problem with php 8.2 (/showthread.php?tid=91362)

Pages: 1 2


Codeigniter 3.2.0 problem with php 8.2 - msheath - 07-29-2024

I have a legacy website originally using CI 3.2 but throwing errors with php 8.2, so I found the website https://github.com/pocketarc/codeigniter/ offering modified files. I have replaced the system files and then got an error:
 
Warning: include(C:\wamp64\www\SPS\application\views\errors\html\error_php.php): Failed to open stream: No such file or directory in C:\wamp64\www\SPS\system\core\Exceptions.php on line 281

From Google advice I then created a folder/file; views/errors/html/error_php.php with contents '<?php
echo "TEST";
?>'

but now the page just shows TEST - and perhaps it should. How can I now get back to normal? I don't understand why the Exceptions.php file is throwing an error at all.

Any advice gratefully received...


RE: Codeigniter 3.2.0 problem with php 8.2 - Bosborne - 07-29-2024

My advice is to upgrade your site to a CodeIgniter version that has support for that version of PHP. I do not think any development is happening on CI3. If that person actually had a valid solution, he should have submitted it as a PR to be included in the official repo releases.


RE: Codeigniter 3.2.0 problem with php 8.2 - msheath - 07-29-2024

(07-29-2024, 03:41 AM)Bosborne Wrote: My advice is to upgrade your site to a CodeIgniter version that has support for that version of PHP. I do not think any development is happening on CI3. If that person actually had a valid solution, he should have submitted it as a PR to be included in the official repo releases.

Well the solution I mentioned has worked for some of my other sites but they were slightly earlier versions of CI (3.0, 3.1). I'm reluctant to upgrade to CI4 because I suspect it will come with a boatload of issues and I will be on this forum for ever sorting it out. Quoting from the CI site:

"CodeIgniter 4 is a rewrite of the framework and is not backwards compatible. It is more appropriate to think of converting your app, rather than upgrading it."

I am guessing that there is one small change needed to my CI3.2 site that will fix it but at the moment I am stuck.


RE: Codeigniter 3.2.0 problem with php 8.2 - Bosborne - 07-29-2024

I have been running CI below 4.5 with no issues. I am waiting for the bugs to settle down in 4.5 before making the move there.


RE: Codeigniter 3.2.0 problem with php 8.2 - msheath - 07-29-2024

(07-29-2024, 08:54 AM)Bosborne Wrote: I have been running CI below 4.5 with no issues. I am waiting for the bugs to settle down in 4.5 before making the move there.

Nevertheless I think I will install the legacy sites on a different framework. Maybe Trongate?


RE: Codeigniter 3.2.0 problem with php 8.2 - kenjis - 07-29-2024

Why don't you have application\views\errors\html\error_php.php ?
Did you removed?

It has been in CI3 since 2013:
https://github.com/bcit-ci/CodeIgniter/commits/master/application/views/errors/html/error_php.php
https://github.com/bcit-ci/CodeIgniter/blob/master/application/views/errors/html/error_php.php


RE: Codeigniter 3.2.0 problem with php 8.2 - msheath - 07-30-2024

(07-29-2024, 05:07 PM)kenjis Wrote: Why don't you have application\views\errors\html\error_php.php ?
Did you removed?

It has been in CI3 since 2013:
https://github.com/bcit-ci/CodeIgniter/commits/master/application/views/errors/html/error_php.php
https://github.com/bcit-ci/CodeIgniter/blob/master/application/views/errors/html/error_php.php

That folder and associated file was not in place but I created it. The result was that I then got just the template with no contents except the text from error_php.php - which doesn't really solve the issue.


RE: Codeigniter 3.2.0 problem with php 8.2 - kenjis - 07-30-2024

Put this file.
https://raw.githubusercontent.com/bcit-ci/CodeIgniter/master/application/views/errors/html/error_php.php


RE: Codeigniter 3.2.0 problem with php 8.2 - msheath - 07-30-2024

I added the file you suggested and got a pretty unhelpful error:

Severity: Warning
Message: include(C:\wamp64\www\SPS\application\views\errors\html\error_exception.php): Failed to open stream: No such file or directory
Filename: core/Exceptions.php
Line Number: 228

Severity: Warning
Message: include(): Failed opening 'C:\wamp64\www\SPS\application\views\errors\html\error_exception.php' for inclusion (include_path='.;C:\php\pear')
Filename: core/Exceptions.php
Line Number: 228

What do you think?


RE: Codeigniter 3.2.0 problem with php 8.2 - kenjis - 07-30-2024

Read the error message carefully.

It is quite obvious.
You don't have the necessary file "application\views\errors\html\error_exception.php".
By default, CI3 has the following files in"application/views/errors/html" folder:
https://github.com/bcit-ci/CodeIgniter/tree/master/application/views/errors/html