nginxÔõôÉó²éÔËÐа汾
ͨ¹ýÏÂÁîÐС¢nginx ÉèÖÃÎļþ»ò php ÐÅÏ¢Ò³ÃæÉó²é nginx ÔËÐа汾£ºÏÂÁîÐУºÔËÐÐ “nginx -v” ÏÂÁî¡£nginx ÉèÖÃÎļþ£º²éÕÒ “nginx_version” Ö¸Áî¡£php ÐÅÏ¢Ò³Ã棺»á¼û “info.php” Îļþ²¢Éó²é “server api” ²¿·Ö¡£
ÔõÑùÉó²é Nginx ÔËÐа汾
ÒªÉó²é Nginx ÕýÔÚÔËÐеİ汾£¬¿ÉÒÔʹÓÃÒÔÏ°취£º
ͨ¹ýÏÂÁîÐÐ
·¿ªÒ»¸öÏÂÁîÐÐÖնˡ£
ÊäÈëÒÔÏÂÏÂÁ
nginx -v
µÇ¼ºó¸´ÖÆ
´ËÏÂÁ´òÓ¡ Nginx ÕýÔÚÔËÐеİ汾ÐÅÏ¢£¬ÀýÈ磺
nginx version: nginx/1.23.1
µÇ¼ºó¸´ÖÆ
ͨ¹ý Nginx ÉèÖÃÎļþ
·¿ª Nginx ÉèÖÃÎļþ£¬Í¨³£Î»ÓÚ /etc/nginx/nginx.conf¡£
²éÕÒÒÔÏÂÐУº
nginx_version nginx;
µÇ¼ºó¸´ÖÆ
°æ±¾ºÅ½«ÏÔʾÔÚ nginx_version Ö¸ÁîÖ®ºó£¬ÀýÈ磺
nginx_version nginx/1.20.1;
µÇ¼ºó¸´ÖÆ
ͨ¹ý PHP ÐÅÏ¢Ò³Ãæ
ÈôÊÇÄúʹÓà PHP£¬»¹¿ÉÒÔʹÓà PHP ÐÅÏ¢Ò³ÃæÀ´Éó²é Nginx °æ±¾£º
½¨ÉèÒ»¸öÃûΪ info.php µÄ PHP Îļþ£¬ÄÚÈÝÈçÏ£º
<?php phpinfo();
µÇ¼ºó¸´ÖÆ
½«´ËÎļþÉÏ´«µ½ÄúµÄ Web ЧÀÍÆ÷¡£
ÔÚä¯ÀÀÆ÷Öлá¼û http://yourdomain.com/info.php¡£
ÔÚ PHP ÐÅÏ¢Ò³ÃæÖУ¬²éÕÒ “Server API” ²¿·Ö£¬Ëü½«°üÀ¨ Nginx °æ±¾ÐÅÏ¢¡£
ÒÔÉϾÍÊÇnginxÔõôÉó²éÔËÐа汾µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡