mecha-cms / mecha

Minimalist content management system.
https://mecha-cms.com
GNU General Public License v3.0
170 stars 22 forks source link

I can't run version 3 on PHP 7.4.33 #287

Closed desbest closed 4 months ago

desbest commented 4 months ago

Make sure that your issue is reproducible by doing the following tasks

What installation method did you use?

File

Describe your issue in the field below

I can't run version 3 on PHP 7.4.33

Package version

Development version (package on the main branch)

Package version number

3.0.0

What browsers are you seeing the problem on?

Firefox

Error logs of the core application if any

[14-May-2024 16:52:14 UTC] PHP Fatal error:  Clone method Genome::__clone() cannot declare a return type in /home/desbest/public_html/flatfiledemo/mecha3/engine/kernel/genome.php on line 3
[14-May-2024 16:52:14 UTC] PHP Fatal error:  Class 'Hook' not found in /home/desbest/public_html/flatfiledemo/mecha3/engine/kernel/genome.php on line 3
[14-May-2024 16:52:14 UTC] PHP Fatal error:  Uncaught Error: Class 'Genome' not found in /home/desbest/public_html/flatfiledemo/mecha3/engine/kernel/hook.php:3
Stack trace:
#0 /home/desbest/public_html/flatfiledemo/mecha3/engine/f.php(1059): require()
#1 [internal function]: {closure}('Hook')
#2 /home/desbest/public_html/flatfiledemo/mecha3/engine/fire.php(170): spl_autoload_call('Hook')
#3 [internal function]: {closure}()
#4 {main}
  thrown in /home/desbest/public_html/flatfiledemo/mecha3/engine/kernel/hook.php on line 3

Error log of the extension if any

No response

Error log of the layout if any

No response

General error logs if any (if the application fails to set a custom error log path, then the error log will usually appear in this location)

[14-May-2024 16:43:35 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function zone() in /home/desbest/public_html/flatfiledemo/mecha/state.php:7
Stack trace:
#0 {main}
  thrown in /home/desbest/public_html/flatfiledemo/mecha/state.php on line 7
taufik-nurrohman commented 4 months ago

Remove the : void part in /home/desbest/public_html/flatfiledemo/mecha3/engine/kernel/genome.php on line 29 and see if it works. I will change it later.

public function __clone() {}
desbest commented 4 months ago

After doing that, now I'm getting this error.

Fatal error: Declaration of Genome::unserialize(string $lot): void must be compatible with Serializable::unserialize($serialized) in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/genome.php on line 100

Fatal error: Uncaught Error: Class 'Genome' not found in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/hook.php:3 Stack trace: 
#0 /home/desbest/public_html/flatfiletest/mecha3/engine/f.php(1059): require() 
#1 [internal function]: {closure}('Hook') 
#2 /home/desbest/public_html/flatfiletest/mecha3/engine/fire.php(164): spl_autoload_call('Hook') 
#3 /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/genome.php(3): {closure}() 
#4 /home/desbest/public_html/flatfiletest/mecha3/engine/f.php(1059): require('/home/desbest/p...') 
#5 [internal function]: {closure}('Genome') 
#6 /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/state.php(3): spl_autoload_call('Genome') 
#7 /home/desbest/public_html/flatfiletest/mecha3/engine/f.php(1059): require('/home/desbest/p...') 
#8 [internal function]: {closure}('State') 
#9 /home/desbest/public_html/flatfiletest/mecha3/engine/fire.php(176): spl_autoload_call('State') 
#10 /home/desbest/public_html/flatfiletest/mecha3/index.php(25): require('/home/desbest/p...') 
#11 { in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/hook.php on line 3
Fatal error: Uncaught Error: Class 'Genome' not found in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/hook.php:3 Stack trace: 
#0 /home/desbest/public_html/flatfiletest/mecha3/engine/f.php(1059): require() 
#1 [internal function]: {closure}('Hook') 
#2 /home/desbest/public_html/flatfiletest/mecha3/engine/fire.php(170): spl_autoload_call('Hook') 
#3 [internal function]: {closure}() 
#4 {main} thrown in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/hook.php on line 3
taufik-nurrohman commented 4 months ago

Looks like : void return type was not set on the Serializable’s unserialize() method interface. Find any methods that ends with : void in the Genome class and then remove that return type as how I did in the last commit. Should fix the issue. Will change it later.

desbest commented 4 months ago

I still get errors after removing every : void

Fatal error: Declaration of Genome::unserialize(string $lot) must be compatible with Serializable::unserialize($serialized) in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/genome.php on line 100

Fatal error: Uncaught Error: Class 'Genome' not found in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/hook.php:3 Stack trace: 
#0 /home/desbest/public_html/flatfiletest/mecha3/engine/f.php(1059): require() 
#1 [internal function]: {closure}('Hook') 
#2 /home/desbest/public_html/flatfiletest/mecha3/engine/fire.php(164): spl_autoload_call('Hook') 
#3 /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/genome.php(3): {closure}() 
#4 /home/desbest/public_html/flatfiletest/mecha3/engine/f.php(1059): require('/home/desbest/p...') 
#5 [internal function]: {closure}('Genome') 
#6 /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/state.php(3): spl_autoload_call('Genome') 
#7 /home/desbest/public_html/flatfiletest/mecha3/engine/f.php(1059): require('/home/desbest/p...') 
#8 [internal function]: {closure}('State') 
#9 /home/desbest/public_html/flatfiletest/mecha3/engine/fire.php(176): spl_autoload_call('State') 
#10 /home/desbest/public_html/flatfiletest/mecha3/index.php(25): require('/home/desbest/p...') 
#11 { in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/hook.php on line 3

Fatal error: Uncaught Error: Class 'Genome' not found in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/hook.php:3 Stack trace: 
#0 /home/desbest/public_html/flatfiletest/mecha3/engine/f.php(1059): require() 
#1 [internal function]: {closure}('Hook') 
#2 /home/desbest/public_html/flatfiletest/mecha3/engine/fire.php(170): spl_autoload_call('Hook') 
#3 [internal function]: {closure}() #4 {main} thrown in /home/desbest/public_html/flatfiletest/mecha3/engine/kernel/hook.php on line 3
taufik-nurrohman commented 4 months ago

Remove the string from the method argument:

public function unserialize($lot) {}
desbest commented 4 months ago

It works now. Thanks for your help.