![](/img/trans.png)
[英]PHP Slim Framework: The requested URL was not found on this server
[英]Server error slim framework php
我有Slim framework的問題。我試圖在屏幕上顯示hello world但是它給了我錯誤:
Server run an intern error and couldn't resolve your request.The server is overloaded or it was an error in a script CGI.
Error 500
我的index.php
<?php
require __DIR__ . '/vendor/autoload.php';
$app = new \Slim\Slim();
$app->get('/hello', function () {
echo "Hello";
});
$app->run(); ?>
和我的.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-F
RewriterULE ^ index.php [QSA, L]
我還在httpd.conf中用以下行修改:
<Directory />
Options All
AllowOverride All
</Directory>
所以當我寫http:// localhost / monologTree / hello時,它從一開始就給出了錯誤。 有什么建議么? 謝謝
檢查您的composer.json文件。 我認為你已經安裝了苗條3.然后試着像這樣實例化苗條
require 'vendor/autoload.php';
$app = new Slim\App();
檢查此示例以正確使用Slim from installation。
第二個解決方案是查找名為httpd.conf的文件,它應該位於** XAMPPInstallDirectory \\ apache \\ conf **中
用記事本打開並找到這一行
#LoadModule rewrite_module modules/mod_rewrite.so
刪除# ,保存,重啟apache(如果正在運行)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.