英文:
Upgrade to PHP 7.4.1 in Ubuntu CI Appication throwing Error. Why?
问题
刚升级到 PHP 7.4.1
按照以下链接操作:https://dev.to/pushkaranand/upgrading-to-php-7-4-26dg
升级后,
CodeIgniter 应用程序出现错误:
类型:错误
信息:调用未定义的函数 mysqli_init()
文件名:/var/www/html/CI_PROJECT/system/database/drivers/mysqli/mysqli_driver.php
尝试:取消 php.ini (/etc/php/7.4/apache2/php.ini) 中以下行的注释:
extension=mysqli
extension=/path/to/extension/mysqli.so
mysqli.allow_local_infile = On
然后执行:
systemctl restart apache2
请为我提供适当的解决方案。
英文:
Just upgraded to PHP 7.4.1
followed by : https://dev.to/pushkaranand/upgrading-to-php-7-4-26dg
After upgrade,
Code-igniter application throwing error like :
Type: Error
Message: Call to undefined function mysqli_init()
Filename: /var/www/html/CI_PROJECT/system/database/drivers/mysqli/mysqli_driver.php
Tried : By uncommentating below line in php.ini (/etc/php/7.4/apache2/php.ini):
extension=mysqli
extension=/path/to/extension/mysqli.so
mysqli.allow_local_infile = On
Then, did
systemctl restart apache2
Please guide me with appropriate solution.
答案1
得分: 3
尝试这样做:
sudo apt-get install php7.4-mysql
然后,在Router.php文件中:
/var/www/html/CI_PROJECT/application/third_party/MX/Router.php
// if (strpos($class, $suffix) === FALSE)
if ($suffix && strpos($class, $suffix) === FALSE)
在Modules.php文件中:
/var/www/html/CI_PROJECT/vv_project/application/third_party/MX/Modules.php
// (is_array($module)) ? list($module, $params) = each($module) : $params = NULL;
(is_array($module)) ? list($module, $params) = [key($module), current($module)] : $params = NULL;
英文:
Try This :
sudo apt-get install php7.4-mysql
Then, in Router.php file
/var/www/html/CI_PROJECT/application/third_party/MX/Router.php
// if (strpos($class, $suffix) === FALSE)
if( $suffix && strpos($class, $suffix) === FALSE)
And in Modules.php File
/var/www/html/CI_PROJECT/vv_project/application/third_party/MX/Modules.php
// (is_array($module)) ? list($module, $params) = each($module) : $params = NULL;
(is_array($module)) ? list($module, $params) = [key($module), current($module)] : $params = NULL;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论