xampp v3.2.4 enabling sqlite3 (WINDOWS 10) 64bit - sqlite

I've setup xampp on my windows machine, and I'm trying to use the sqlite3 module with php 7.4.3
I've edited my php.ini file and adjusted the extension=sqlite3 and restarted the service.
When i try and run this:
<?php
$db = new SQLite3('test.db');
?>
I get this error:
Fatal error: Uncaught Error: Class 'SQLite3' not found
I've also tried using pdo:
$db = new PDO("sqlite:".__DIR__."/test.db");
And with that i get this error instead:
Fatal error: Uncaught PDOException: could not find driver
Now I'm sure i have the sqlite3 ext because when i check the php/ext folder i can see the php_sqlite3.dll
I haven't changed anything else in the php.ini regarding the dir for the ext but im sure it's all setup correctly since all the other extensions are working just fine. Maybe I'm just being ignorant and I'm using sqlite3 incorrectly so please if someone knows the problem enlighten me.

Go in your XAMPP\php\php.ini, modify it with a text editor
Search for ;extension=sqlite3 with CTRL + F
Remove the ; to uncomment the line
Restart Apache to apply change
Now you are able to use Sqlite3 on XAMPP for Windows :D

Uncomment extension=sqlite3 in php.ini:
;extension=sqlite3
=>
extension=sqlite3
and restart Apache.

libsqlite3.dll isn't installed in the xampp\apache\bin folder.
you have to go into xampp\php copy libsqlite3.dll and paste into xampp\apache\bin.
easy fix, not sure why it isn't installed there in the first place ¯_( ͡° ͜ʖ ͡°)_/¯

Related

XDG_RUNTIME_DIR , propagateSizeHints() errors

When I run this script "python3 script.py" everything is alright.
(I tried to run the script as a root, and other user too)
import music21
import os
# "qt.qpa.xcb: could not connect to display"
# "qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found."
os.putenv("QT_QPA_PLATFORM", "offscreen") #handle error above in my case
us = music21.environment.UserSettings()
us['musescoreDirectPNGPath'] = '/usr/bin/musescore3'
score = music21.converter.parse("myfile.musicxml")
score.write('musicxml.pdf', fp='song.pdf')
But when my django backend has to execute this code as a function to respond API call, its not working. I got:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-myusername'
This plugin does not support propagateSizeHints()
And if I remove part with "QT_QPA_PLATFORM", I got "qt.qpa.xcb" error.
I have not idea what to do.
I also tried to add following line in my gunicorn setup script but nothing changed.
export QT_QPA_PLATFORM=offscreen
Any ideas how to fix it ? What can be wrong ?
Server OS: Ubuntu 20.04
You probably need to also set XDG_RUNTIME_DIR. See https://github.com/cuthbertLab/music21/issues/260#issuecomment-834489173

symfony/silex csr.token_manager not defined

i have a project in silex that works perfectly on my Windows running xampp, but when i cloned it to my Ubuntu it threw the error "InvalidArgumentException in Container.php line 96:
Identifier "csrf.token_manager" is not defined."
I'm not using xampp or lamp on Ubuntu so i guess it could be some configuration of the apache2 or php.
I had an error before with csrf_provider and solved it with
$app['form.csrf_provider'] = null;
but if i try do do something like that it says it espects CsrfProviderInterface or CsrfTokenManagerInterface or null, or it just ignores if i'm logged in or not. I tried to find something around but i just found how to handle the token manager manually, i just want it to work as is. Thanks in advance.
Thanks to mTorres i solved it registering the CsrfTokenProvider
use Silex\Provider\CsrfServiceProvider;
$app->register(new CsrfServiceProvider());
No idea why it works on windows whitout it though.

Meteor Jade Handlebars on Windows 8 - Jade compiler error: Cannot read property 'length' of undefined

I'm attempting to use jade in meteor with this package https://github.com/SimonDegraeve/meteor-jade-handlebars
I'm on a windows machine. I've so far managed to use most meteorite packages by following the instructions here (www.discovermeteor.com/2013/03/20/using-meteor-and-atmopshere-on-windows/)
When i run 'meteor' on my project with .jade files, I'm getting this error:
While building the application:
client\todos.jade: Jade compiler error: Cannot read property 'length' of undefin
ed
=> Your application has errors. Waiting for file change.
Terminate batch job (Y/N)?
I tried to use this new fork too -> https://github.com/kynan/meteor-jade-handlebars/tree/refactor-for-meteor-0.6.5
Same problem.
I further tested this in a Linux machine and it works perfectly. I have no idea why this is failing with the above mention error on windows.
Try adding a blank extra line to the end of your file. For example, an extra line would be needed here.
template(name="name")
h1 Hello!
I've been dealing with a lot of problems getting jade-templating to work with meteor, but finally got it to work.. Here's how:
Add this to smart.json, belt-jade-handlebars is jade for newer versions of meteor:
"packages": {
"belt-jade-handlebars": {}
}
Add this to .meteor/packages:
belt-jade-handlebars
And finally add the extra blank line to all *.jade files. ( suggested by user3064375 )
Start the app by using:
$ meteor run --release template-engine-preview-3
This will use the latest template engine and start meteor.

Error Loading Zend Gdata framework into Wordpress

I am trying to use the Zend Gdata framework with wordpress but I am having some issues.
Now everything works perfectly fine when I test on localhost with XAMPP. However on my web server my code breaks down.
Here is my code to include the framework.
`set_include_path(TEMPLATEPATH . '/includes/');
require_once ('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata_Youtube');`
That code produces the following error.
Warning: Zend_Loader::include_once(Zend/Gdata/Youtube.php) [zend-loader.include-once]: failed to open stream: No such file or directory in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Zend/Gdata/Youtube.php' for inclusion (include_path='/home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/') in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Gdata/Youtube.php" does not exist or class "Zend_Gdata_Youtube" was not found in the file' in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php:99 Stack trace: #0 /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/modules/yt_link_checker.php(19): Zend_Loader::loadClass('Zend_Gdata_Yout...') #1 /home/damain/public_html/mysite.com/wp-includes/plugin.php(405): load_zend_gdata('') #2 /home/damain/public_html/mysite.com/wp-admin/admin.php(111): do_action('load_zend_gdata', Array) #3 /home/damain/public_html/mysite.com/wp-admin/index.php(10): require_once('/home/damain/...') #4 {main} thrown in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 99
I cannot seem to figure this issue out. Can anyone help?
The best solution in this case is to run the script requiring the Zend Loader and use var_dump(get_include_path()) to see what the server says the path is. Then keep modifying the php.ini include_path until the script finds it.
In your case, I'm not sure if 'damain' is supposed to be 'domain'. My include path which finally worked was:
/home2/thelove6/public_html/zf/ZendGdata/library" thelove6 being the username.
Did you look to see if those files exist in those directories? (/mysite/includes/Zend/Loader.php) and they have the correct permissions? It sounds like that could very well be the issue. The other thing to check with a simple phpinfo() would be that you have all of the libraries install on the live server.
Ok, the possible reason is: You're not using the proper case for the classname. For the version 1.11.11, it will be Zend_Gdata_YouTube rather than Zend_Gdata_Youtube.
Windows OS is ignoring the case, whereas the Linux server does not. Hope this will solve your problem, just look at the proper case of the Class or filenames.

PHPExcel exception: "Could not close zip file ... "

I am using XAMPP a Mac for local development, but I used this code at work (using Windows and an otherwise identical development environment) and it worked fine:
$objPHPExcel = new PHPExcel();
$sheet = $objPHPExcel->createSheet();
$sheet->fromArray($a);
...
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
//$objWriter->save('P:/Projects/Mess3/Sadness.xlsx');
$objWriter->save('/Users/tjb1982/Desktop/sadness.xlsx');
The commented-out text works with my Windows system at work. I tried to output the file to 'php://output' and got a garbled mess (is that what is to be expected?).
I can't seem to find anyone who is experiencing this problem outside of those who had permissions problems or had the file open when they were trying to save it. Please help!
I was getting the same error "Cannot close zip file.." and realized it didn't have permissions to write to that directory. Check your write permissions. (IIS8 + php + mysql + oracle)
Once i allowed write permissions problem was immediately fixed.
Generally this means one of 3 things:
The directory where you're trying to save the file doesn't exist
The directory/file has permissions that preclude you from writing to it
The file is already open in some other application, or has a lock on it
I had the same problem, just added the path in the save method and it worked
$objWriter->save(dirname(FILE)."dir1"."/".$file.".xlsx");
I found that this problem is caused when you execute the code once and then open the outputted excel file with Office excel. Try closing the file in excel and then try! Hope this helps!
I had the same problem, actually you have to modify the basic rights of reading and writing given to your PHPWord directory:
chmod -R 777 PHPWord/

Resources