{"id":7935,"date":"2015-11-10T12:48:08","date_gmt":"2015-11-10T12:48:08","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/10\/slim-framework-always-return-404-error-open-source-projects-slimphp-slim\/"},"modified":"2015-11-10T12:48:08","modified_gmt":"2015-11-10T12:48:08","slug":"slim-framework-always-return-404-error-open-source-projects-slimphp-slim","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/10\/slim-framework-always-return-404-error-open-source-projects-slimphp-slim\/","title":{"rendered":"Slim Framework always return 404 Error-open source projects slimphp\/Slim"},"content":{"rendered":"<p>These days i&#8217;m using <strong>Slim Framework<\/strong> as my simplest tool to develop the php web api. Using these two articles:<\/p>\n<p>I follow some of the steps from there. Downloading the Slim Framework, putting the correct directory &amp; files. Adjusting the initation statements such as;<\/p>\n<pre><code>\/\/1. Require Slim\nrequire('Slim\/Slim.php');\n\n\/\/2. Instantiate Slim\n$app = new Slim();\n\n\/\/3. Define routes\n$app-&gt;get('\/books', function ($id) {\n    \/\/Show book with id = $id\n});\n<\/code><\/pre>\n<p>And then, I modify the rest accordingly.<\/p>\n<p>Such as my checklist that already done:<\/p>\n<ul>\n<li>LoadModule rewrite_module modules\/mod_rewrite.so -&gt; enabled<\/li>\n<li>Slim .htaccess:<\/li>\n<\/ul>\n<blockquote>\n<p>RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ bootstrap.php [QSA,L]<\/p>\n<\/blockquote>\n<ul>\n<li>httpd.conf: (Shared Link).<\/li>\n<\/ul>\n<p>But, after Once I run this statement;<\/p>\n<pre><code>$app-&gt;run();\n<\/code><\/pre>\n<p>And I run it on my browser&#8230;. then, I got <strong>404 Error<\/strong> while testing it on my Localhost. What&#8217;s the solution for fixing that?<\/p>\n<p>FYI, here is my simplest PHP file that i&#8217;m currently using it. (shared Link)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These days i&#8217;m using Slim Framework as my simplest tool to develop the php web api. Using these two articles: I follow some of the steps from there. Downloading the Slim Framework, putting the correct directory &amp; files. Adjusting the initation statements such as; \/\/1. Require Slim require(&#8216;Slim\/Slim.php&#8217;); \/\/2. Instantiate Slim $app = new Slim(); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7935","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7935"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7935\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}