# Server closes when running PHP sample app

**URL:** <https://community.auth0.com/t/server-closes-when-running-php-sample-app/72994>\
**Category:** Get Help\
**Tags:** auth0-php, composer, php\
**Created:** [November 11, 2021, 3:48pm UTC](https://community.auth0.com/t/server-closes-when-running-php-sample-app/72994 "2021-11-11T15:48:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![janik.driehaus](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/janik.driehaus/32/12805_2.png) [@janik.driehaus](https://community.auth0.com/u/janik.driehaus)\
**Post date:** [November 11, 2021, 3:48pm UTC](https://community.auth0.com/t/server-closes-when-running-php-sample-app/72994/1 "2021-11-11T15:48:02Z")

</div>

When executing either of the following

> `composer run app`  
> `php -S 127.0.0.1:3000 index.php`

Accessing this address in the browser returns a blank page.

The output of the following commands upon execution is:

> `composer run app`:
> 
> ![image](https://global.discourse-cdn.com/auth0/original/3X/9/8/9861824ce9ed6be6daec636849a4230616346325.png)

> `php -S 127.0.0.1:3000 index.php`:  
> _See the last line in the screenshot above._

The browser window, with `http://127.0.0.1:3000` as a URI, is empty as follows:  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/3/2/32fbe209c7befc8dad9dd796b2e672daf452b274.png)

Switching back to the terminal:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/4/64a9b9f1fe9a86c74e3f9f87ecb6f149e899a7d6.png)

Can someone tell me what I’m doing wrong?  
With kind regards.

---

<div class="post-metadata">

**Author:** ![evansims](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evansims/32/27011_2.png) [@evansims](https://community.auth0.com/u/evansims)\
**Post date:** [November 29, 2021, 8:56pm UTC](https://community.auth0.com/t/server-closes-when-running-php-sample-app/72994/2 "2021-11-29T20:56:50Z")

</div>

Hey @janik.driehaus 👋 I notice in a few of your examples you’re mentioning `php -S 127.0.0.1:3000 index.php` - be sure that you’re invoking `php -S 127.0.0.1:3000 public/index.php` from the `app` directory. This appears to be the issue in your final example.

In the second-to-last example, can you confirm you have a `.env` file present in the `app` directory?

---

<div class="post-metadata">

**Author:** ![janik.driehaus](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/janik.driehaus/32/12805_2.png) [@janik.driehaus](https://community.auth0.com/u/janik.driehaus)\
**Post date:** [January 3, 2022, 8:34am UTC](https://community.auth0.com/t/server-closes-when-running-php-sample-app/72994/3 "2022-01-03T08:34:00Z")

</div>

Hey Evan,  
please pardon the long delay. I was able to get the sample app to run, many thanks! You’ve saved me a headache. 😃

I redownloaded the sample and followed the steps for installing composer; I must have run the commands in a wrong directory.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 18, 2022, 8:34am UTC](https://community.auth0.com/t/server-closes-when-running-php-sample-app/72994/4 "2022-01-18T08:34:56Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
