一聚教程网:一个值得你收藏的教程网站

热门教程

Nginx PHP5环境Socket配置教程

时间:2022-06-30 18:37:03 编辑:袖梨 来源:一聚教程网

Socket扩展是基于流行的BSD sockets,实现了和socket通讯功能的底层接口,它可以和客户端一样当做一个socket服务器。


NGINX配置:

[root@LNMP conf]# cat nginx.conf
        location ~ \.php$ {
            root    html;
            try_files $uri =404;
            fastcgi_pass unix:/tmp/php.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
}

PHP配置:

[root@LNMP conf]# vim /usr/local/php/etc/php-fpm.conf
;listen = 127.0.0.1:9000
listen = /tmp/php.sock
php_admin_value[open_basedir]=/home/wwwroot/site/:/tmp/    #安全选项,防跨目录

热门栏目