php - 无法在 ubuntu 18.04 中更改 php 版本
问题描述
我正在尝试在我的 ubuntu 18.04 中更改我的 php 版本。我想从 7.0 更改为 7.2。我已将 php 更新到 7.2。将 php 版本从sudo a2enmod php7.2
.
在终端:
$ php --ini
Configuration File (php.ini) Path: /etc/php/7.2/cli
Loaded Configuration File: /etc/php/7.2/cli/php.ini
Scan for additional .ini files in: /etc/php/7.2/cli/conf.d
在本地主机中:
<?php phpinfo();?>
PHP Version 7.0.30-1+ubuntu18.04.1+deb.sury.org+1
System Linux linux 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24
06:16:15 UTC 2018 x86_64
Build Date May 2 2018 12:44:20
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php/7.0/apache2
Loaded Configuration File (none)
Scan this dir for additional .ini files /etc/php/7.0/apache2/conf.d
在终端:
php -version
PHP 7.2.5-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: May 5 2018
05:00:15) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.5-1+ubuntu18.04.1+deb.sury.org+1, Copyright
(c) 1999-2018, by Zend Technologies
我无法确定问题出在哪里。在我清除 php 7.0 后也没有解决问题。
解决方案
请试试:
sudo apt install libapache2-mod-php7.2
sudo service apache2 restart
推荐阅读
- c++ - 如何检测我的程序是否进入自死锁?
- opengl - OpenGL:除非打印到控制台,否则不会渲染颜色(从统一)
- r - 如何在 Jupyter Notebook 上打印 R 中的整个数据框?
- google-cloud-platform - 如何在我自己的网站上的图像上使用 Google 的 Vision API
- regex - 基于正则表达式分离列 | 熊猫
- javascript - 无法更改反应挂钩中的复选框
- c++ - 如何从 cmake 在窗口中构建 32/64 位 dll?
- solidity - 在 Truffle 中使用构造函数部署智能合约
- azure - Azure DevOps:如何将 VS 配置文件设置复制到 yml 脚本中
- javascript - 使用已创建的值数组创建 xy 数组