HELP! No sqlite extension

Status
Not open for further replies.

broeastx

New Member
Messages
8
Reaction score
0
Points
1
Test Script confirms bad sqlite:
PHP:
<?

if (function_exists('sqlite_open'))
{
echo 'Sqlite PHP extension loaded<br>sqlite_libversion: ';
echo sqlite_libversion();
}
else echo 'No sqlite extension';

echo "<br><br>PHP Version: ";
echo phpversion();
?>
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
You have to use this:
http://www.php.net/manual/en/book.sqlite3.php

PHP:
<?php
print_r(SQLite3::version());
class MyDB extends SQLite3
{
    function __construct()
    {
        $this->open('mysqlitedb.db');
    }
}
$db = new MyDB();
$db->exec('CREATE TABLE foo (bar STRING)');
$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')");
$result = $db->query('SELECT bar FROM foo');
var_dump($result->fetchArray());

Works on my account on Vox

Alternatively, you can use PDO with SQLite driver.

See: http://henryranch.net/software/ease-into-sqlite-3-with-php-and-pdo/

His code also works on Vox.
 
Last edited:

broeastx

New Member
Messages
8
Reaction score
0
Points
1
Please tell me why my sqlite cms (front page script) isn't working at all, DOA. It's in the folder named "main"; added to the domain name I purchased and added to my account. The domain name works fine, but not the \main\index.php Please resolve this, or at least take a look at it. Another problem is that my php random image scripts aren't working at all, which are located in the scripts folder; which are used in the test page called "c16.php".
Thanks in Advance,
xbroeast (account)
 

broeastx

New Member
Messages
8
Reaction score
0
Points
1
PS: I'd read elsewhere that modding the the htaccess and php.ini by adding the buffer/cache statements would get the image scripts going, but no dice. Please have a look at this too (added both).
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,929
Reaction score
118
Points
63
We do not provide official support for third party scripts. Additionally, you'll be hard-pressed to find any support without providing additional details such as error messages and relevant code snippets. The majority of people helping here do not have access to look at your account's files.

Also, you cannot modify php.ini on Free Hosting, even via .htaccess. This is to prevent abuse; all users are subject to the same PHP configuration (which should be good enough for the vast majority of use cases anyway).
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Your SQLite script does not run because that method of invoking SQLite has been removed from recent versions of PHP. x10hosting is running PHP 5.5. You would need PHP 5.3 or older.

In the .htaccess file where the SQLite script is loacated, add the line:

Code:
AddType application/x-httpd-php53 .php .php5 .phtml

This (at least for now) will run your PHP scripts using PHP Version: 5.3.27.

This (at least for now), should give you access to "sqlite_libversion: 2.8.17" (results of running your scriptlet on Vox with the .htaccess edited per above).

No idea on the images without more information (maybe a URL where the image errors happen?).
 

broeastx

New Member
Messages
8
Reaction score
0
Points
1
descalzo,

Many thanks for your expert egghead assistance ;)
The test script failure led me to assume that sqlite wasn't running at all.
Is it possible that the image script failure may be for the same reasons?

Original random image script is this one:
http://ma.tt/scripts/randomimage/

It's being utilized in the left nav of this x10 page:
http://alturl.com/k5tdb

The second php image script isn't working either. it's called PHPSHOW.php,
and it's being utilized in the center content of this x10 gallery page. Clicking
one of the images invokes the script and the thumbnail images it creates aren't
showing up at all. Click to start the slidesow anyway, and full size slides are
working okay. I'd previously been modifying the php.ini (with .htaccess permissions
mod) to add this:
Code:
output_buffering = On
And the htaccess modified to add this:
Code:
suPHP_ConfigPath /home/broeastx/public_html
Again, here's the failing phpshow script invocation page: http://alturl.com/pbj2u

Thank you so much for your input/assistance,
broeastx
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,929
Reaction score
118
Points
63
Once again, you do not have access to modify php.ini, and those .htaccess tricks you are trying are actually doing nothing.
 

broeastx

New Member
Messages
8
Reaction score
0
Points
1
Skiz,
Just like the sqlite issue, I'm left to assume that the img scripts are no longer compatible.
Many many thanks for your support and this fine service.
broeastx
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Concerning the image script, what does it require? The Admins were adding ImageMagick and that seemed to cause some problems with WordPress. Not sure if they kept GD around. I assume that the script uses one or the other to create the thumbnails on the fly.

Did you try moving back the PHP version that I suggested for SQLite? That might fix the image problem too.
 

broeastx

New Member
Messages
8
Reaction score
0
Points
1
descalzo,
Your back version patch resolved two of three issues, the sqlite and the phpshow script.
I'll find a workaround for the http://ma.tt/scripts/randomimage/
Many thanks again for your experience and support in this issue.
broeastx
 
Last edited:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
The image thing probably relies on imagemagick, which isn't installed.
 

leroymc2

New Member
Messages
9
Reaction score
0
Points
1
the script for the image works.

http://crimsonminecraft.pcriot.com/random.php

check it out. its the one from the link you gave for the script.

what are you trying to do with it?

this is the same code all i did was put images/ in $folder='location of images';
Code:
<?php
/*
By Matt Mullenweg > http://photomatt.net
Inspired by Dan Benjamin > http://hiveware.com/imagerotator.php
Latest version always at:

http://photomatt.net/scripts/randomimage

*/// Make this the relative path to the images, like "../img" or "random/images/".
// If the images are in the same directory, leave it blank.
$folder = 'folder where images are.';

// Space seperated list of extensions, you probably won't have to change this.
$exts = 'jpg jpeg png gif';

$files = array(); $i = -1; // Initialize some variables
if ('' == $folder) $folder = './';

$handle = opendir($folder);
$exts = explode(' ', $exts);
while (false !== ($file = readdir($handle))) {
  foreach($exts as $ext) { // for each extension check the extension
  if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive
  $files[] = $file; // it's good
  ++$i;
  }
  }
}
closedir($handle); // We're not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
$rand = mt_rand(0, $i); // $i was incremented as we went along

header('Location: '.$folder.$files[$rand]); // Voila!
?>
 

broeastx

New Member
Messages
8
Reaction score
0
Points
1
I was calling the image script from an image tag and it wouldn't cooperate; and so I changed it to one called rotate.php which works like a dream. I've got a buddy modding phpshow.php gallery for me to add site banner and footer, and also adding image labels on the thumbs page (commercial product samples). Just that phpshow.php doesn't use javascript, and so it's probably better for mobile devices. Creates it's own thumbs and albums.

Can I ask another stupid question here without getting flamed? How do I use the css first-child element to style the first Li of a Ul? I can't get it to cooperate, it takes all of them. Oh, and I can't add class or Id to the LI because it's part of a auto generated UL ( same php cms script).

Many thanks in Advance,
 

broeastx

New Member
Messages
8
Reaction score
0
Points
1
The server migration update now denies me the htaccess mod and comes back with a fatal connection refused error, crashes the entire site. Can someone please look at the attached cms.php and fix my headache "class sqlitedatabase not found"?
 

Attachments

  • wcms.zip
    8.9 KB · Views: 0
Status
Not open for further replies.
Top