如果使用php命令行里想获取etho网卡的IP怎么处理呢 ? public function get_server_ip() { if (PHP_SAPI === 'cli'){ $buffer = ""; $handle = popen("ifconfig eth0|grep 'inet addr'|awk -F'[ :]' '{print $13}'", 'r'); while(!feof($handle)) { $buffer.=fgets($handle); } pclose($handle); $server_ip = rtrim(