Fatal error: require_once() [function.require]: Failed opening required '__DIR__
<p>I'm new to PHP and Android. I've tried to find a solution on existing threads, but no success.</p>

<p>I'm working on an android project in which I need to connect to external database. I've managed to create an external database using WAMP and it worked fine on a localhost.</p>

<p>Now I'm trying to get the external DB online and I'm using the 000webhost.com.
I've created a copy of my database via 000webhost.com services and trying to connect to the DB via my scrips and the credentials that the 000webhost.com provided me with. (DB_HOST, DB_USER and etc...)</p>

<p>I have a script that should display all existing users. i.e. it should connect to the DB and display in web browser all the information from the DB (I'm connecting through web to <a href="http://www.mywampserver.netau.net/android_connect/get_all_users_placedescoverer.php" rel="nofollow">http://www.mywampserver.netau.net/android_connect/get_all_users_placedescoverer.php</a>), but it fails with the following error:</p>

<pre><code>Warning: require_once(__DIR__/android_connect/db_connect_placedescoverer.php)
[function.require-once]: failed to open stream: No such file or directory in 
/home/a2056935/public_html/android_connect/get_all_users_placedescoverer.php
on line 12
</code></pre>

<p>In my get_all_users_placedescoverer.php in line 12 i have:</p>

<pre><code>require_once __DIR__ . '/android_connect/db_connect_placedescoverer.php';
</code></pre>

<p>And <code>db_connect_placedescoverer.php</code> exists in the same folder as <code>et_all_users_placedescoverer.php</code>.</p>

<p>I've also tried to use:</p>

<pre><code>require_once(realpath(dirname(__FILE__)'/android_connect/db_connect_placedescoverer.php'));
</code></pre>

<p>but then i get:</p>

<blockquote>
  <p>Warning: require_once() [function.require-once]: <strong>Filename cannot be empty in</strong> /home/a2056935/public_html/android_connect/get_all_users_placedescoverer.php on line 13</p>
</blockquote>

<p>A help on this would be highly appreciated.</p>
