error using kohana 3.3.3.1 mysqli - mysqli

I have put this driver to MODPATH/database and changed type to 'MySQLi' in APPPATH/config/database.php and got an error Class 'Database_MySQLi_Result' not found. What am I doing wrong?
PHP Version 5.5.3-1ubuntu2.6
MySQL 5.5.37

Problem solved. I set access rights to the folder to 777.

Related

Error when activating a TYPO3 extension using Composer

I am running the following command in the directory where my root composer.json file is located:
./vendor/bin/typo3 extension:activate slickcarousel
However, I get the following error in return:
In ConnectionPool.php line 110: The requested database connection named "Default" has not been configured.
Even though I have configured my database in my LocalConfiguration.php. I also cannot find the ConnectionPool.php file in the vendor directory. How do I fix this error?
Do you use a different TYPO3 Context maybe? then you need to set that as well with
TYPO3_CONTEXT=Development ./vendor/bin/typo3 extension:activate slickcarousel

Why I get 500 Error while on XAMPP while loading CodeIgniter 3 database library?

I have gone through number of threads on stackoverflow and on other forums to find the answer but could not find relevant answer. People have applied different approaches but none has worked for me thus far.
I am using CI 3 on XAMPP and whenever I load database library in the model, I run into 500 Error.
Here is my CI database config info:
'hostname' => 'localhost',
'username' => 'my_user',
'password' => 'my_pass',
'database' => 'prod_db',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
PHP ini db libraries are as below:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
My model code is as below:
class loginmodel extends CI_Model {
public function validate_login($username, $password) {
$this->load->database();
$var = 0;
return $var;
}
}
Whenever I remove $this->load->database(); from the model, my code runs and i am able to redirect to a "Login Failed" page. BUT, whenever I load my database library in autoload.php or load it in above model, code fails.
Autoload.php
$autoload['libraries'] = array('database');
Apache error logs showed below errors but I could not figure as why this was happening.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_mysqli.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_pdo_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0
Please advise.
EDIT:
I verified all config to be OK and as stated in the comments, I added environment variables to windows and verified through PHPInfo that mysqli and mysqlnd were loaded.
Despite getting all the config right, error still persisted and I did a clean install of CI to reproduce library load failure. This time CI returned an error that db access was denied.
I then realized that after migration, database user was not created in the new environment. So once I created the desired user and assigned it required privileges, I was able to run the code just fine.
Therefore, if anyone encounters such issue in future, below steps might help:
First and foremost, verify if your desired user can access the
database.
Modify your .htaccess to use your desired URL schemes only after
verifying that database connection is working
Then verify that absolute path is available in PHP.ini on XAMPP.
Plus, verify that PHP is added in the environment variables. My
Values on Windows 10 are as follows: Variable Name: PHP , Variable
Value: C:\xampp\php\ext
In CI, mysqli is selected as database driver
In PHP.ini mysqli extension is enabled. i.e. php_mysqli.dll
Echo PHPInfo to verify that mysqli and mysqlnd are available in your
installation.
If nothing works, do a clean install of CI on a separate directory and load database library after setting up your database configuration and before setting up .htaccess until you can reproduce the error.
Hope that error will be eliminated!

undefined function TYPO3\CMS\IndexedSearch\mb_strcut()

I'm trying to create a webpage using TYPO3 8.7, but when i go to Localhost/index.php it says "Oops an error has occured".
The only way i can see my webpage, is through the TYPO3 backend login apperently.
This is the error that it logs in the backend of TYPO3:
>
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Call to undefined >function TYPO3\CMS\IndexedSearch\mb_strcut() | Error thrown in file >/var/www/html/typo3_src-8.7.0/typo3/sysext/indexed_search/Classes/Indexer.php in >line 1314. Requested URL: Localhost/index.php
And my line 1314 is this:
$bodyDescription = mb_strcut($bodyDescription, 0, $maxL, 'utf-8');
I'm very new to this. So far i've been able to sort all bugs with the help from these forums and others, but unfortunately I can't find any solution to this one.
Any help is greatly appreciated.
Let me know if i need to provide some additionel information.
This error means that mbstring php extension is not enabled. You should install it, if you have Ubuntu you should execute
sudo apt-get install php-mbstring
Read more about installation of this PHP extension here

PHP Fatal error: Class 'MongoDate' not found

I use lithium console (lithium/console/li3) to run some command and I get this error:
PHP Fatal error: Class 'MongoDate' not found
My system details:
mongodb server: 2.6.1
php mongodb client: 1.5.2
apache 2.4.7
php 5.5.9-1ubuntu4
$Requests = Requests::find('all', array('conditions'=>array(
'expired'=>array('<'=>new \MongoDate(time())),
'processed'=>0
)));
I don't have this error while running this code in older version system
PHP Version 5.3.10-1ubuntu3.11
Apache/2.2.22 (Ubuntu) Server
mongodb client: 1.4.5
mongodb server: 2.4.10
Thank you.
One more thing: I try to create just a simple script
$date = new MongoDate();
it runs without problem via webserver (browser) but if I use php command to run this file, I get the same error: Class 'MongoDate' not found
So I believe that it's php command problem.
For people that have come here using PHP7, the classs has been renamed:
MongoDate is now MongoDB\BSON\UTCDateTime
Also I've found that this now wants miliseconds instead of seconds, so make sure you multiple your input by 1000, for example:
$date = new \MongoDB\BSON\UTCDateTime(strtotime('yesterday') * 1000);
Make sure your mongodb extension is loaded.
var_dump(extension_loaded('mongodb'));
If not, you must load it in php.ini.

Exception while creating sp.xml using ssoadmin

I am facing this exception when I trying to create the sp.xml using the ssoadmin :
com.sun.identity.cli.CLIException: AdminTokenAction: FATAL ERROR: Cannot obtain Application SSO token.
Check AMConfig.properties for the following properties
com.sun.identity.agents.app.username
com.iplanet.am.service.password
at com.sun.identity.cli.LogWriter.log(LogWriter.java:109)
at com.sun.identity.cli.Authenticator.ldapLogin(Authenticator.java:170)
at com.sun.identity.cli.AuthenticatedCommand.ldapLogin(AuthenticatedCommand.java:144)
at com.sun.identity.federation.cli.CreateMetaDataTemplate.handleRequest(CreateMetaDataTemplate.java:113)
at com.sun.identity.cli.SubCommand.execute(SubCommand.java:291)
at com.sun.identity.cli.CLIRequest.process(CLIRequest.java:212)
at com.sun.identity.cli.CLIRequest.process(CLIRequest.java:134)
at com.sun.identity.cli.CommandManager.serviceRequestQueue(CommandManager.java:573)
at com.sun.identity.cli.CommandManager.(CommandManager.java:171)
at com.sun.identity.cli.CommandManager.main(CommandManager.java:148)
And I also tried adding something like this in the ssoamdin.bat :
-D"com.iplanet.am.naming.map.site.to.server=https://lb.example.com:443/openam=http://server1.example.com:8080/openam"
But the same exception...
How to fix it?
Thanks in advance,
The 'map-to-site' property is only needed if you have a site configured an the host where you run ssoadm is not able to talk to the siteURL.
You may set -Dcom.iplanet.services.debug.level=message -Dcom.iplanet.services.debug.directory=WRITABLE_EXISTING_DIRECTORY' as JVM options within ssoadm.bat.
You may then look into the debug directory you should find a pointer what's wrong.
The above got sorted in my case when i went to the ssoadmin folder openam/bin and found the ssoadm.bat file and opened it in the edit mode and added the following two lines in the java comaand :
-D"javax.net.ssl.trustStore=F:\tomcatsslkeystore" (tomcat keystore path)
-D"javax.net.ssl.trustStorePassword=tomcatsslkeystore" (tomcat keystore password)