codeigniter auto loading the database even though i removed from autoload.php - php

I am developing a site in php and I am using codeigniter as framework.
I removed database in $autoload['libraries'] from autoload.php. But it is showing error when i removed database credentials from database.php.
I don't understand the problem here.I must be able to load the site without a database connection. According to the documentation I just shouldn't load any database. But it is throwing an error. How to resolve this issue?
The error is:
Unable to connect to your database server using the provided settings.
Filename: C:\wamp\www\mlp\system\database\DB_driver.php
Line Number: 124

You may be calling database library by loading it somewhere in your script. by using $this->library->load('database') try removing that. ... ELSE ...Try to clear your browser cache... Refresh the project once... Restart apache(if it doesnt work even after the previous two).

If you removed database from autoload.php it is not possible to show the error message, if this message is showing you had used the library any of your controller.

Related

Moodle - "Can not initialise PHP session, please verify that your browser accepts cookies."

I am unable install MOODLE in localhost as it gives following error:
Can not initialize PHP session, please verify that your browser accepts cookies.
I tried to find the solution but was unable to come up with any. I've also referred this, still I'm stuck with the same problem.
I had a whitespace in my localhost URL path. Removing it (and updating $CFG->wwwroot in config.php) fixed this issue for me.

When I click on connect to quickbooks, the resulting pop up window has a blank session. How can I fix this?

I'm using QuickBooks PHP DevKit from consolibyte. I was unable to locate the version number, but it was a recent nightly build. I am attempting to connect to a QuickBooks Online installation using the sample files in
docs/partner_platform/example_app_ipp_v3/ as a base.
The tenant_id for my application is stored in the session. When I click on the 'Connect to Quickbooks' button, it brings up oauth.php in a new window. The tenant_id is always blank because the entire session is missing, despite the session_start(); that I've added to oauth.php.
How can I get the session variable to show up? If the tenant_id needs to be added to the url, where do I add it? I don't see any way to modify the behavior of clicking on the <ipp:connectToIntuit></ipp:connectToIntuit> button.
I finally figured out what was going on. In the config file, I had $quickbooks_oauth_url="https://myserver.com/oauth.php"
instead of
"https://www.myserver.com/oauth.php".
Since I was coming from https://www.myserver.com, it was treating https://myserver.com/oauth.php as a different website with a different session. Now that I've added the www to the config file, it's working as expected.

CodeIgniter site issue upon uploading it to live server

I am a beginner in PHP and MVC, I just developed a project in CodeIgniter and it was complete and working superb on my local machine. So I registered a domain and uploaded my site to the live server and the exported the db by sql file, and there are were a ton of problems that I faced, and I am still stuck.
It Won't accept the database information from the config file 'database.php', although it was correct, then I found out that I needed to set 'db_debug' to FALSE, so i did that and i changed the 'db_driver' from 'mysql' to 'mysqli' because of a deprecation error, and then had to comment out an elseif block in the BASEPATH/system/database/drivers/mysqli/mysqli_driver.php in the 'escape_str' function, and then that dear error was gone. And the site was running.
But as I tried to signup the is_unique validation rule wasn't working because it kept giving back the error, even when there was no such value in the db table, then I tried deleting that rule and then the form was submitted successfully but there were no entries made in the db. My guess is that the db connection is not being established.
I have loaded the 'database' library in the autoload.php.
Now the site is still working great on my local machine, and I can't figure out the problem.
When you set db_debug to false, it just doesn't show the database errors, but doesn't actually solve anything. Actually it was a newly registered domain, so it took some time to assign the user to the db, i guess. because when I tried again after a few hours, The database connection succeeded, and it is working great.

kohana db exception [0]

I have a big problem with connecting to mysql database. I tried everything and nothing worked.
If i try to connect on localhost with xampp to db on kohana (3.1.2), i get this error:
Database_Exception [ 0 ]: ~ MODPATH\database\classes\kohana\database\mysql.php [ 67 ]
but if i try run it on some server, it runs there and i dont know why, because everything is same (except db user and password).
I thought that it can be with mysql config, but i dont know what there.
I just came across this problem and figured out what it was so even though this question is old, people having this problem should know the answer.
Basically when you get this error its because your using a version of php 5.5+.
mysql_connect(...) is a depreciated function starting in php 5.5 and above so the call in the framework is wrapped around a try/catch but the output from the catch doesn't give you any details about the error for whatever reason but if you remove the try/catch you'll see the real php error is simple saying mysql_connect is depreciated and will be removed in the future and to use mysqli instead.
To fix this open index.php in your root and basically you need to change the error_reporting(...) call to tell it not to error on depreciation errors which you can do like so to report all errors except warnings and deprecations.
error_reporting(E_ALL ^ (E_WARNING | E_DEPRECATED));
Another fix is to change your database config file to connect via PDO instead of mysql.
I checked in Kohana 3.2, and there it means it can't connect to your database and throws an exception on that. But just go to the line 67 of the mysql.php file and check if the exception is triggered just after trying to connect to the DB.
Check your credentials in database config and make sure your MySQL server is up and running.

Codeigniter Cache Driver 500 error on load

I want to use the CI cache driver but when I use $this->load->driver('cache'); in MY_Controller.php or a normal controller I get a server error page (500 error).
I am using CI 2.1.3
Any idea in how to fix it? What could be the problem?
Okay, apparently you need to load it $this->load->library('cache'); even though its a driver.
EDIT// Never mind it was all a mess because of a CI error, I am using the 3.0 Driver model now and it works.
Check your error logs.
Probably means your cache directory doesn't have sufficient permissions!

Categories