开启web服务器
$ cd ~/public_html
$ php -S localhost:8000
终端会有如下类似提示
PHP 5.4.0 Development Server started at Thu Jul 21 10:43:28 2011
Listening on localhost:8000
Document root is /home/me/public_html
Press Ctrl-C to quit
访问一下:http://localhost:8000/.出现如下类似提示
PHP 5.4.0 Development Server started at Thu Jul 21 10:43:28 2011
Listening on localhost:8000
Document root is /home/me/public_html
Press Ctrl-C to quit.
[Thu Jul 21 10:48:48 2011] ::1:39144 GET /favicon.ico – Request read
[Thu Jul 21 10:48:50 2011] ::1:39146 GET / – Request read
写一个路由脚本
// router.php
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"]))
return false; // serve the requested resource as-is.
else {
echo "
Welcome to PHP
";}
How to Use Cycling Shoes
weight loss tips Fashion and Music Makes Sense
the fall of camelot nicely significant mishaps
gay pornPanama Hats symbol of excellence