@ubuntu18.04 安装lnmp php时出错
报错代码
lnmp Starting php-fpm /etc/init.d/php-fpm: 57: /etc/init.d/php-fpm: /usr/loc…
Error:PHP install Failed;
方法
查看 root下的 lnmp-install.log 文件
cd root/
笔者的原因是php编译时很多.c .cpp .h文件报错
ubuntu18.04的gcc和g++ 版本太低
因此要切换到高版本
cd到/usr/bin下,使用指令
ls /usr/bin/gcc*
ls /usr/bin/g++*
查看版本号
切换到7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
//100是占比, 填100绝对用7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100
还有可能出问题
查看g++版本号
g++ -v
可能报错
g+ -v
反而是对的,这时必须将g+ 目录改成g++
cd usr/bin/
mv g+ g++