<?php
$host = '127.0.0.1';
$port = 8080;
$url = "http://{$host}:{$port}";

// 根据系统打开浏览器
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
    exec("start {$url}");
} elseif (PHP_OS === 'Darwin') {
    exec("open {$url}");
} else {
    exec("xdg-open {$url}");
}

// 启动内置服务
echo "https://www.990046.com/：{$url}\n";
passthru("php -S {$host}:{$port}");
?>