Ubuntu 16.04 VPS中为PHP 5.6安装SOAP模块及Linux镜像更新问题
Hey there, let's work through your issues step by step—since you're running both PHP 5.6 (your active version) and PHP 7.0 on Ubuntu 16.04, plus dealing with leftover packages and kernel image problems, here's what you need to do:
The apt-get install php-soap command you ran installs the SOAP module for the default PHP version on Ubuntu 16.04, which is PHP 7.0—not your active PHP 5.6. To get the correct module for PHP 5.6, run this instead:
apt-get install php5.6-soap
Once it finishes, restart Apache to load the new module:
systemctl restart apache2
You can verify it's installed correctly by running:
php5.6 -m | grep soap
If you see soap in the output, you're good to go.
The packages the system flagged (old kernel headers, libssl1.0.2) are leftover dependencies that aren't needed anymore. To safely remove them, use:
apt autoremove --purge
If you want to double-check what will be deleted before committing, run a dry run first:
apt autoremove --dry-run
This will show you the list of packages to be removed without making any changes.
Old kernel images can cause update conflicts or take up unnecessary space. First, check which kernel your system is currently using:
uname -r
Then list all installed kernel images to see which ones are outdated:
dpkg --list | grep linux-image
Look for kernel versions that are older than the one returned by uname -r, then remove them with a command like this (replace the version numbers with the old ones from your list):
apt remove --purge linux-image-4.4.0-21-generic linux-image-4.4.0-72-generic linux-image-4.4.0-75-generic linux-image-4.4.0-78-generic
After removing the old images, update GRUB to reflect the changes:
update-grub
You can reboot your VPS if you want to ensure it's using the latest installed kernel, though this isn't strictly necessary unless you're having boot issues.
内容的提问来源于stack exchange,提问作者MOR GAN

