目前我正在使用ubuntu,我想在我的系統中安裝PHP Slim framework
。超薄框架無法正常工作
我已經通過命令行安裝了composer,並且還手動安裝了Slim框架,然後我在slim文件夾中創建了一個index.php文件,並將下面的代碼放在該文件中,並且當我嘗試運行該文件時看不到。
<?php
require 'vendor/autoload.php';
$app = new SlimApp();
//slim application routes
$app->get('/', function ($request, $response, $args) {
$response->write("Welcome: This is AlphansoTech Tutorial Guide");
return $response;
});
$app->run()
?>
我試圖撥打http://localhost/slim/index.php
,顯示我空白屏幕。
我不知道第一次發生什麼事我正在安裝和使用苗條框架。
我試過下面的url來安裝slim框架。
http://www.alphansotech.com/blogs/php-restful-api-framework-slim-tutorial/
https://www.slimframework.com/docs/tutorial/first-app.html
https://www.slimframework.com/docs/start/installation.html
如何安裝或使用超薄框架上運行的API?
您是否檢查安裝指南? https://www.slimframework.com/docs/start/installation.html –