# How to run index.php without using command prompt in Slim Framework?

**URL:** <https://discourse.slimframework.com/t/how-to-run-index-php-without-using-command-prompt-in-slim-framework/4776>\
**Category:** Questions\
**Created:** [May 5, 2021, 7:19am UTC](https://discourse.slimframework.com/t/how-to-run-index-php-without-using-command-prompt-in-slim-framework/4776 "2021-05-05T07:19:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prkvv](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@prkvv](https://discourse.slimframework.com/u/prkvv)\
**Post date:** [May 5, 2021, 7:19am UTC](https://discourse.slimframework.com/t/how-to-run-index-php-without-using-command-prompt-in-slim-framework/4776/1 "2021-05-05T07:19:55Z")

</div>

Hi team,  
We made a simple API using Slim framework.  
while see the result of coding in the Postman website we should configure our public folder in the command prompt.  
For example:  
`E:\xampp\htdocs\slim_project\public>php -S localhost:8000`  
If we run this command then only the slim output was came correctly. Otherwise the error message was appear.  
In our project, we are making a mobile application using B4X language.  
In the application I can’t configure the above command in the command prompt.

Is there any possible to run the index.php file without run the command in the command prompt?  
In browser I just give the whole directory name like localhost/slim\_project/public  
But it return the Method not allowed errro message.  
I just want run the index.php without running this `E:\xampp\htdocs\slim_project\public>php -S localhost:8000` command in command prompt.  
Any suggestion ?

Regards

---

<div class="post-metadata">

**Author:** ![odan](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@odan](https://discourse.slimframework.com/u/odan)\
**Post date:** [May 5, 2021, 8:55am UTC](https://discourse.slimframework.com/t/how-to-run-index-php-without-using-command-prompt-in-slim-framework/4776/2 "2021-05-05T08:55:36Z")

</div>

With the command `php -S localhost:8000` you are starting the [PHP built-in webserver](https://www.php.net/manual/en/features.commandline.webserver.php).

When the php webserver is startet you can open the url `http://localhost:8000` to run the application (index.php).

The built-in PHP web server is intended for local **development** only and not for production because it can handle only one request at the same time.

To run only the `index.php` file you could just run `php index.php`. But this may not work, because the Slim routing requires a HTTP context for the routing and dispatching.

So the question is, what do you really want to achieve?  
Is it not possible to use a HttpClient class in B4X?

---

<div class="post-metadata">

**Author:** ![prkvv](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@prkvv](https://discourse.slimframework.com/u/prkvv)\
**Post date:** [May 5, 2021, 10:32am UTC](https://discourse.slimframework.com/t/how-to-run-index-php-without-using-command-prompt-in-slim-framework/4776/3 "2021-05-05T10:32:02Z")

</div>

Thanks for your suggestion sir. Solved
