Note that there are some explanatory texts on larger screens.

plurals
  1. POClass not found even though it is located where I am looking for it
    primarykey
    data
    text
    <p>I am trying to load a class in order for a PHP script that I wrote, with help of the classes' documentation, to work.</p> <p>Since my server is running PHP 5.3, the documentation recommended loading the class like this:</p> <pre><code>spl_autoload_register(function($class){ if (file_exists('/webgit/webroot/home/myUsername/www/elastica/lib/' . $class . '.php')) { echo " found \n "; require_once('/webgit/webroot/home/myUsername/www/elastica/lib/' . $class . '.php'); } else { echo " not found! "; } }); </code></pre> <p>The only things that are different are that I included echo's in the suite of the if and else. Also myUsername is actually my username in the file-system path on the server.</p> <p>Then, it ( the documentation ) suggests that I make a new instance of the class like so:</p> <pre><code>$elasticaClient = new \Elastica\Client(); </code></pre> <p>However, I am getting an error that the class is not found. Here is exactly what is printed including the error and the suite of my if-else:</p> <p>not found! Fatal error: Class 'Elastica\Client' not found in /webgit/webroot/home/myUsername/www/elastica/index.php on line 17</p> <p>line 17 is the line where I try to make an instance of the class.</p> <p>now, index.php is where the above code is and it is located, on my server, in /webgit/webroot/home/myUsername/www/elastica/</p> <p>and all the class files are in /webgit/webroot/home/myUsername/www/elastica/lib/</p> <p>so, I don't understand why it is not able to find / load the class.</p> <p>I would greatly appreciate any help in solving this!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload