The general problem is this, not PHP installation failed, that is, MySQL installation failed, or Nginx installation failed
is basically a fancy error. Later in the military elder brother's forum found this post: https://bbs.vpser.net/viewthread.php?tid=16700&highlight=ubuntu17.10
In simple terms, the GCC version is a problem.
I thought about it--switch version:
Let's see what the GCC and g++ are for our system.
gcc -v
The information you can get is as follows
gcc version 7.2.0
What if we want to use GCC5? First see if there is gcc5 installed,
ls /usr/bin/gcc*
Results only/usr/bin/gcc/usr/bin/gcc-7 Two, then we need to install
sudo apt-get install gcc-5 gcc-5-multilib g++-5 g++-5-multilib
After installation, enter the following command:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 40
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50
Then enter:
sudo update-alternatives --config gcc
You will see the following options, and there are 3 candidates for replacing GCC (providing/USR/BIN/GCC).
Select Path Priority state
------------------------------------------------------------
* 0/USR/BIN/GCC-5 50 Auto mode
1/USR/BIN/GCC-5 50 Manual Mode
2/USR/BIN/GCC-7 40 Manual Mode
To maintain the current value [*], press ENTER, or type the number you selected:
If you want to use which GCC, enter the number.
Also set the g++
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 40
If you want to delete the optional option, you can type the following command:
sudo update-alternatives --remove gcc /usr/bin/gcc-5
Here is a view of the g++ version switchable
sudo update-alternatives --config g++
One sentence: gcc and g++ versions switch to the same version at the same time, such as: GCC7, g++7, switch to GCC5, g++5, to compile successfully.
Roughly so.
Installation complete, in the browser input: http://localhost/can be normal access--tossing me for two days.
ubuntu17.10 Install LNMP installation package core issue-GCC version, g++ version