1、php版本尽量统一,不要使用多个版本的php[尤其是php和php-fmp的版本要一致]
2、对应于java的maven,php中有composer编译器,类似于导入相关jar包的操作,对应于java的tomcat,php中有php-fpm“容器”
3、注意nginx的配置,端口占用问题,nginx错误日志的查看
问题记录:
Call to undefined function curl_init()
解决办法:
//问题描述:由于对php的不了解,安装了好几个版本的php,并且php7.0,php7.2,php7.1-fpm,php7.2-curl
//卸载所有的php版本
sudo aptitude purge dpkg -l | grep php| awk '{print $2}' |tr "\n" " "
//重新安装php、php7.2-fpm、php7.2-curl、修改nginx配置文件中对php7.2-fpm的配置
sudo apt-get install php7.2
apt-get大法好哈哈哈哈,apt-fast推荐下
sudo apt-fast install php7.2-fpm
sudo apt-fast install php7.2-curl
//Class ‘Redis’ not found
sudo apt-fast install php-redis
记得重启服务哈~
service php7.2-fpm start
service apache2 start
service nginx start