我曾多次尝试让php 5.6在ubuntu 16.04上运行
尝试浏览http:/domain.com/phpinfo.php以检查哪个版本的php处于活动状态时服务器错误500(服务器还有7.0,7.1和7.2)
尝试运行php 7.1时,我也有同样的错误(7.0和7.2正在运行没有问题,我有在virtualmin服务器上运行的网站。
我已经在这里看了很多关于这种事情的答案,但是说实话,答案往往是如此破碎和不同,我找不到一个可靠且有效的程序。
有人帮忙吗?
例如,以下ispconfig 3教程,在/ opt目录中安装php5.6,是否可以使用virtualmin? (https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/)
我的假设是上面的教程可以工作,我只需要告诉virtualmin php 5.6二进制文件在/ opt /中的位置? (见这个帖子...... https://www.virtualmin.com/node/40004)
首先添加ppa:ondrej/php
存储库:
sudo -s
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:ondrej/php
如果在这一点上它抛出一个CPG错误,如:
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY <THE_KEY>
W: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
..注意在显示THE_KEY的第二行,然后解决:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <THE_KEY>
最后:
apt-get update
apt-get install -y php5.6
php -v