簡體   English   中英

Codeigniter 4 composer update PHP Fatal error: Uncaught Error: Call to a member function run() on int in index.php

[英]Codeigniter 4 composer update PHP Fatal error: Uncaught Error: Call to a member function run() on int in index.php

我剛剛使用 composer 將我的 Codeigniter 4 站點從 4.1 更新到 4.2,現在在 Apache 錯誤日志中出現以下服務器錯誤:

PHP Fatal error: Uncaught Error: Call to a member function run() on int in /var/www/vhosts/site/public/index.php

我在想文件已更改或 CI 4.2 需要缺少 PHP 庫,但我查看了.env、/public/index.php 和 /app/config/App.ZE1BFD762321E409CEEZ3AC06 文件並沒有更改.

任何幫助將非常感激

Codeigniter v4.2.0變更

index.phpspark文件在 v4.2.0 中有顯着變化。 要升級,您必須合並新版本。

如果您使用的是標准 CI4 index.php(您尚未修改它):

cd <root-dir-of-CI-project>
cp vendor/codeigniter4/framework/public/index.php public/index.php

同樣對於標准 CI4 spark (你沒有修改它):

cd <root-dir-of-CI-project>
cp vendor/codeigniter4/framework/spark .

ELSE合並新版本的index.php spark與您當前的版本合並。

https://codeigniter4.github.io/userguide/installation/upgrade_420.html#index-php-and-spark

composer update
cp vendor/codeigniter4/framework/public/index.php public/index.php
cp vendor/codeigniter4/framework/spark

https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_420.html

我從 CI 版本升級:4.1 到 4.2

起初我使用的命令:

作曲家更新

它更新了我的 CI 框架和文件,但沒有更新 Spark 和 Index 文件。

但是下面的命令修復了 Spark 和 Index。 我還附上了下面的 CI 文檔鏈接:

作曲家更新--prefer-source

https://codeigniter4.github.io/userguide/installation/installing_composer.html#adding-codeigniter4-upgrading

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM