一痒芝、lnmp安裝
lnmp的安裝參照了某博客網(wǎng)站上的教程俐筋,實(shí)用其安裝腳本,省去了很多事严衬。教程地址如下:
https://blog.linuxeye.cn/31.html
二澄者、配置
1、PHP配置
進(jìn)入php的安裝位置请琳,使用上面腳本安裝默認(rèn)安裝在/usr/local/php下粱挡,在/usr/local/php/etc找到php.ini配置文件,將將cgi.fix_pathinfo的值改成1俄精,然后service php-fpm reload重啟询筏;
2、nginx配置
進(jìn)入路徑下/usr/local/nginx/conf/vhost嘀倒,新建一個(gè).conf文件屈留,文件內(nèi)容如下:
server {
listen 80;
server_name goooooo.top www.goooooo.top;
access_log /data/wwwlogs/www.goooooo.top_access.log;
error_log /data/wwwlogs/www.goooooo.top_error.log;
set $root /data/wwwroot/www.goooooo.top/public;
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;
}
}
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;
}
}
具體內(nèi)容不一一細(xì)說(shuō)了,關(guān)鍵注意的是下面這段內(nèi)容
fastcgi_pass unix:/dev/shm/php-cgi.sock;
上面這段內(nèi)容主要看你的php-fpm.conf上面的配置测蘑,路徑是/usr/local/php/etc灌危,比如我的php-fpm.conf配置是
[www]
listen = /dev/shm/php-cgi.sock
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
三、注意
以上內(nèi)容只針對(duì)上面的安裝腳本進(jìn)行過(guò)測(cè)試碳胳,其他的安裝方法未必有效
四勇蝙、參考地址:
http://www.thinkphp.cn/topic/40391.html
https://www.cnblogs.com/xuey/p/7631690.html
https://blog.csdn.net/qq_35912734/article/details/78477924