redcrusher Posted September 29, 2011 Share Posted September 29, 2011 When i get onto a new server, i put a php file on it and see what versions of php sqlite and mysql there are. For some reason, when i put it on this server, it does not show anything ... 2 of the lines: echo sqlite_libversion(); echo phpversion(); Other php commands work and i am able to call simple methods and what not. But for some reason those commands and a sqlite query is not working . Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/ Share on other sites More sharing options...
Buddski Posted September 29, 2011 Share Posted September 29, 2011 Have you tried a vardump? See if anything is being returned. vardump(phpversion()) Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273795 Share on other sites More sharing options...
btherl Posted September 29, 2011 Share Posted September 29, 2011 I would try just phpinfo(). My guess is that the server is configured not to display errors and sqlite_libversion() is not defined. Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273801 Share on other sites More sharing options...
redcrusher Posted September 29, 2011 Author Share Posted September 29, 2011 ok so, IF i use: echo phpinfo(); echo phpversion(); It works. But if i use: echo sqlite_libversion(); if does not work and nothing under it works either. On that path, $db = "database/mtg.db3"; // open database file $handle = sqlite_open($db) or die("Could not open database"); // generate query string $query = "SELECT * FROM cards"; // execute query $result = sqlite_query($handle, $query) or die("Error in query: ".sqlite_error_string(sqlite_last_error($handle))); // if rows exist if (sqlite_num_rows($result) > 0) { // get each row as an array // print values echo "<table cellpadding=10 border=1>"; while($row = sqlite_fetch_array($result)) { echo "<tr>"; echo "<td>".$row[0]."</td>"; echo "<td>".$row[1]."</td>"; echo "<td>".$row[2]."</td>"; echo "</tr>"; } echo "</table>"; } // all done // close database file sqlite_close($handle); This does not output anything. Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273838 Share on other sites More sharing options...
trq Posted September 29, 2011 Share Posted September 29, 2011 Are you sure sqlite is installed? Sounds like it might be throwing a fatal error which you obviously can't see because your error reporting is off. Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273839 Share on other sites More sharing options...
redcrusher Posted September 29, 2011 Author Share Posted September 29, 2011 [~]$ yum list | grep -i sqlite python-sqlite.i386 1.1.7-1.2.1 installed sqlite.i386 3.3.6-5 installed mono-data-sqlite.i386 1.2.4-2.el5.centos extras pdns-backend-sqlite.i386 2.9.21-4.el5.centos extras qt4-sqlite.i386 4.2.1-1 base sqlite-devel.i386 3.3.6-5 base Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273840 Share on other sites More sharing options...
Buddski Posted September 29, 2011 Share Posted September 29, 2011 That just shows the you have sqlite installed on the server. Is it configured in PHP? If you turn on error reporting in your script error_reporting(E_ALL); You will most likely see an undefined function error. Check your PHP config file to see if the sqlite extension is enabled. Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273842 Share on other sites More sharing options...
redcrusher Posted September 29, 2011 Author Share Posted September 29, 2011 error_reporting(E_ALL); echo sqlite_libversion(); ect... This works just like before. nothing shows up ... as for sqlite ... if i do phpinfo() i get: pdo_sqlite PDO Driver for SQLite 3.x enabled PECL Module version 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $ SQLite Library 3.3.6 Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273847 Share on other sites More sharing options...
trq Posted September 29, 2011 Share Posted September 29, 2011 Turn display errors on. Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273881 Share on other sites More sharing options...
xyph Posted September 29, 2011 Share Posted September 29, 2011 Try this <?php $db = new SQLite3( ':memory:' ); var_dump( $db->version() ); ?> The SQLite3 package is much different than the SQLite package, as odd as that is Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1273910 Share on other sites More sharing options...
redcrusher Posted September 29, 2011 Author Share Posted September 29, 2011 when errors are displaying: Fatal error: Call to undefined function sqlite_libversion() in /var/www/vhosts/mtgproxydeckbuilder.com/subdomains/alpha/httpdocs/test.php on line 8 [/doce] and [code] Fatal error: Class 'SQLite3' not found in /var/www/vhosts/mtgproxydeckbuilder.com/subdomains/alpha/httpdocs/test.php on line 10 Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1274057 Share on other sites More sharing options...
btherl Posted September 29, 2011 Share Posted September 29, 2011 Ok you've now identified the problem - sqlite IS installed in your system, but not installed in php. I don't know enough about your OS to help further, but there appear to be related comments here - http://php.net/manual/en/sqlite.installation.php Quote Link to comment https://forums.phpfreaks.com/topic/248074-commands-but-no-output/#findComment-1274225 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.