These days i\'m using Slim Framework as my simplest tool to develop the php web api. Using these two articles:
For me the problem was that I'd forgotten to provide a .htaccess file in my document root.
.htaccess
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . index.php [L]