Note that there are some explanatory texts on larger screens.

plurals
  1. POquerypath working on local but not server
    primarykey
    data
    text
    <p>so I've been developing something using querypath on my local environment which is MAMP based php 5.3.6, but when I moved it to my development server it stops working. My development server is LAMP based with php 5.3.2-1ubuntu4.10. I cannot for the life of me figure out why it would work on my local but not my test. I do have the correct php extensions enabled on both environments.</p> <p>It seems to have something to do with the querypath files in the include. The PHP/MySQL is working fine in both environments. Querypath requires the 'libxml' and 'dom' extensions to be enabled, which they are in both environments. There is nothing showing up in my php error log, if querypath has an error log then that is something I was not aware of.</p> <p>A basic example is that this will get a response on my local environment:</p> <pre><code>&lt;?php $url = 'http://www.google.com'; $html = htmlqp($url); print '&lt;h1&gt;TEST&lt;/h1&gt;'; print_r ($html); ?&gt; </code></pre> <p>On my development enviroment the 'TEST' will not print, indicating that there was some sort of fatal error in accessing querypath. And, yes, I have checked my relative paths rigorously.</p> <p>Update: A colleague returned from vacation today, he advised me to try using the qp() function instead of htmlqp(), this did not make anything work better, but it did yield an error, which was helpful: Fatal error: Class '\QueryPath\DOMQuery' not found in /Library/WebServer/Documents/fGalaxy54/fGalaxy54/include/QueryPath/src/QueryPath.php on line 158 </p> <p>So for some reason the auto loader is not loading the DOMQuery class, and I have been recopying the files to the server to make sure things were not corrupt. In any case, my colleague pointed me to a copy of querypath he was hosting somewhere else on the server and for some reason that copy works fine. So, nothing's solved but I have a working copy elsewhere on the server. Thanks for all the comments.</p> <p>Edit again for further clarification:</p> <p>The querypath autoloader was not loading the DOMQuery class, when I used a different autoloader everything worked fine on my development environment. Not sure if this is some kind of qp bug, but it's a strange quirk indeed.</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.
    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