Home > Backend Development > PHP Tutorial > php klein路由库的一个问题

php klein路由库的一个问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:26:39
Original
1167 people have browsed it

<code><?php require_once __DIR__ . '/vendor/autoload.php';
 
$klein = new \Klein\Klein();
 
$klein->respond('GET', '/hello-world', function () {
    return 'Hello World!';
});
 
$klein->dispatch();</code>
Copy after login
Copy after login

按照文档demo实例,的代码但是当我访问localhost/hello-world时页面却什么都没输出,在刷新chrome的f12时显示404 not found,文件包括整个文件夹的写权限已经给了775,求解答

回复内容:

<code><?php require_once __DIR__ . '/vendor/autoload.php';
 
$klein = new \Klein\Klein();
 
$klein->respond('GET', '/hello-world', function () {
    return 'Hello World!';
});
 
$klein->dispatch();</code>
Copy after login
Copy after login

按照文档demo实例,的代码但是当我访问localhost/hello-world时页面却什么都没输出,在刷新chrome的f12时显示404 not found,文件包括整个文件夹的写权限已经给了775,求解答

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template