# Error with manual install: Failed opening required '\_\_DIR\_\_/lib/discourse.php'

**URL:** https://meta.discourse.org/t/error-with-manual-install-failed-opening-required---dir---lib-discourse-php/28788
**Category:** WordPress
**Created:** [13 مايو 2015، 9:02م UTC](https://meta.discourse.org/t/error-with-manual-install-failed-opening-required---dir---lib-discourse-php/28788 "2015-05-13T21:02:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mikegreenberg](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@mikegreenberg](https://meta.discourse.org/u/mikegreenberg)
#### Post date: [13 مايو 2015، 9:02م UTC](https://meta.discourse.org/t/error-with-manual-install-failed-opening-required---dir---lib-discourse-php/28788/1 "2015-05-13T21:02:02Z")

</div>

I manually downloaded the latest master ZIP from the repo, dropped it into `public_html/blog/wp-content/plugins/wp-discourse/`, and clicked Activate. It produced the following error:

```
Warning: require_once( __DIR__ /lib/discourse.php) [function.require-once]: failed to open stream: No such file or directory in [REDACTED]public_html/blog/wp-content/plugins/wp-discourse/wp-discourse.php on line 30

Fatal error: require_once() [function.require]: Failed opening required ' __DIR__ /lib/discourse.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in [REDACTED]public_html/blog/wp-content/plugins/wp-discourse/wp-discourse.php on line 30

```

Not sure if this was designed to install this way, but the installation notes are sparse in this regard. The only way I was able to fix it was to replace ` __DIR__ ` with `WPDISCOURSE_PATH` in [wp-discourse/wp-discourse.php at main · discourse/wp-discourse · GitHub](https://github.com/discourse/wp-discourse/blob/master/wp-discourse.php#L30-L32).

Not sure where ` __DIR__ ` is initialized, but it wasn’t clear how to best fix this. Thoughts on my fix? Is this a bug?

---

<div class="post-metadata">

### Author: ![mikegreenberg](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@mikegreenberg](https://meta.discourse.org/u/mikegreenberg)
#### Post date: [13 مايو 2015، 9:11م UTC](https://meta.discourse.org/t/error-with-manual-install-failed-opening-required---dir---lib-discourse-php/28788/2 "2015-05-13T21:11:46Z")

</div>

Additionally, after installing the plugin and attempting to trigger a post to discourse, I got:

```
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in [REDACTED]/public_html/blog/wp-content/plugins/wp-discourse/lib/discourse.php on line 470

Warning: file_get_contents(http://[HOSTNAME]/posts) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in [REDACTED]/public_html/blog/wp-content/plugins/wp-discourse/lib/discourse.php on line 470

Warning: First parameter must either be an object or the name of an existing class in [REDACTED]/public_html/blog/wp-content/plugins/wp-discourse/lib/discourse.php on line 475

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in [REDACTED]/public_html/blog/wp-content/plugins/wp-discourse/lib/discourse.php on line 470

Warning: file_get_contents(http://[HOSTNAME]/posts) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in [REDACTED]/public_html/blog/wp-content/plugins/wp-discourse/lib/discourse.php on line 470

Warning: First parameter must either be an object or the name of an existing class in [REDACTED]/public_html/blog/wp-content/plugins/wp-discourse/lib/discourse.php on line 475

Warning: Cannot modify header information - headers already sent by (output started at [REDACTED]/public_html/blog/wp-content/plugins/wp-discourse/lib/discourse.php:470) in [REDACTED]/public_html/blog/wp-admin/post.php on line 235

Warning: Cannot modify header information - headers already sent by (output started at [REDACTED]/public_html/blog/wp-content/plugins/wp-discourse/lib/discourse.php:470) in [REDACTED]/public_html/blog/wp-includes/pluggable.php on line 1196

```

1. I setup the API key from discourse and configured the “system” username. Wordpress install is latest vanilla (4.2.2).

- I loaded an existing post, clicked on “Post in discourse” in the publishing area and clicked “Update”
- Above errors were displayed.

---

<div class="post-metadata">

### Author: ![mikegreenberg](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@mikegreenberg](https://meta.discourse.org/u/mikegreenberg)
#### Post date: [13 مايو 2015، 9:18م UTC](https://meta.discourse.org/t/error-with-manual-install-failed-opening-required---dir---lib-discourse-php/28788/3 "2015-05-13T21:18:29Z")

</div>

> [@mikegreenberg](#):
>
> URL file-access is disabled in the server configuration

This appears to be related to the `allow_url_fopen` PHP config being set to `OFF`. Will investigate it being enabled…

---

<div class="post-metadata">

### Author: ![benword](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benword/32/493782_2.png) [@benword](https://meta.discourse.org/u/benword)
#### Post date: [14 مايو 2015، 5:14م UTC](https://meta.discourse.org/t/error-with-manual-install-failed-opening-required---dir---lib-discourse-php/28788/4 "2015-05-14T17:14:19Z")

</div>

Are you not running at least PHP 5.3?

---

<div class="post-metadata">

### Author: ![mikegreenberg](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@mikegreenberg](https://meta.discourse.org/u/mikegreenberg)
#### Post date: [14 مايو 2015، 5:42م UTC](https://meta.discourse.org/t/error-with-manual-install-failed-opening-required---dir---lib-discourse-php/28788/5 "2015-05-14T17:42:51Z")

</div>

No. It’s 5.2.17.

I’ve already determined that this server is not appropriate. I’m exploring how to run Wordpress in a docker container on the same host as discourse. I have concerns about risk of managing/exposing a PHP runtime on port 80 and having to manage multiple domains routing to the same socket. I have light devops skills, but can understand everything pretty well. Just sad that my initial effort of getting wordpress + discourse to go is turning out to be a tall order so far.

Thanks for the follow up.

---

<div class="post-metadata">

### Author: ![mikegreenberg](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@mikegreenberg](https://meta.discourse.org/u/mikegreenberg)
#### Post date: [14 مايو 2015، 7:36م UTC](https://meta.discourse.org/t/error-with-manual-install-failed-opening-required---dir---lib-discourse-php/28788/6 "2015-05-14T19:36:08Z")

</div>

For other interested parties, this appears to be the direction I will end up going in:

> **[Need help with installing Discourse and Wordpress | DigitalOcean](https://www.digitalocean.com/community/questions/need-help-with-installing-discourse-and-wordpress)**
>
> Is there any documentation on installing Discourse Forums and Wordpress on the same server? I have Discourse running, I just need help with getting Wordpres…
