1、安装lnmp:不多BB,拿到了新的阿里云ECS主机,一键安装lnmp命令:wget http://soft.vpser.net/lnmp/lnmp1.5.tar.gz -cO lnmp1.5.tar.gz && tar zxf lnmp1.5.tar.gz && cd lnmp1.5 && ./install.sh lnmp,选择好mysql,php等版本后安装大概半个钟完成。完成后输入ip(设置安全组后),结果如图安装成功
打开phpmyadmin可能会报错:配置文件权限错误,不应任何用户都能修改
原因:phpmyadmin目录权限过高,设置了777访问权限
解决:sudo chmod -R 755 phpmyadmin
2、安装tp5!在tp5官网下载压缩包,通过ftp上传到wwwroot目录并解压(解压:unzip 文件名),在linux下输入命令:
cd /usr/local/nginx/conf/vhost,进入虚拟机配置的目录,新建一个www.tp5.com.conf,写入配置的内容如下:
server { listen 80; server_name www.tp5.com; access_log /data/wwwlogs/tp5.log combined; error_log /data/wwwlogs/tp5_error.log; set $root /data/wwwroot/tp5/public; location ~ \.php { fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_split_path_info ^((?U).+.php)(/?.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name; include fastcgi_params; } location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ { root $root; } location / { root $root; index index.html index.php; if ( -f $request_filename) { break; } if ( !-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; } } }
保存后直接简单粗暴重启lnmp,输入命令 :lnmp restart
原文:https://www.cnblogs.com/hjxcode/p/9297161.html