CodeIgniter site issue upon uploading it to live server - php

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.

Related

error in processing request error text:error (rejected) it seems that the connection to server is been lost.Cannot make changes directly into table

error in processing request error text: error (rejected) it seems that the connection to the server is been lost. Please check your network connectivity and server status.
This is the type of error that I am facing while working with a website hosted in an AWS instance.
Now, I have changed the auth_type to 'cookie', and added a username and password in the config.inc.php file, in PHPMyAdmin.
can't figure out the actual problem, cause if I try to update an entity attribute, it works absolutely fine, while trying to delete entity results in an error.

Wordpress Error Establishing Database Connection

I have reinstalled phpAdmin (due to another issue) and updated wp-config with the correct names for DB, user name, password, etc, but now I cannot access the wordpress site (www.enablie.co.uk, www.enablie.co.uk/wp-admin or http://www.enablie.com/phpmyadmin).
I have tried adding the repair code
define('WP_ALLOW_REPAIR', true);
But still cannot access via : http://www.enablie.co.uk/wp-admin/maint/repair.php.
I am also getting this error when trying to access sql -
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
On Chrome is is showing a basic version of the site (broken styles) when not logged in, but get the EEDC as soon as try to log in. On Safari I have the EEDC immediately.
I assume I have just done something stupid, but most errors seem to suggest naming errors in the config file which I know is not the case. I have also checked the db still exists via mysql to ensure that there is not a problem there.
I assume that the re-install removed something from the overall settings that I now need to manually reconfigure, but I can't find any guidance that points me where to look so would appreciate some help on what I need to change. Much appreciated!
I rebooted by instance and that seemed to fix the issue.

PHP - cannot Host - SQL flow error

I want to upload my program from c9.io to Versio.nl.
I downloaded FileZilla
Uploaded everything
Created database on the server
But I keep on receiving errors with mysqli_driver and credentials.
This is the first time I try to upload a project to a server
You need to update all the places where you define the connection to the db.
Set the user, the password and the host as specified by the hosting provider and the error 1 will be fixed
The second error is coming because of the first and should probably disappear after fixing the first

Database can't connect on live server and blank page is displayed, all fine on Xampp

I am trying to setup a second instance of a website for testing purposes. I use the exact same files as the original version and all works fine when I test it on Xampp.
However, when I upload the files on the live server, something gets wrong. When the pages are loaded they appear as blank, there is no SQL error displayed, I tried this as well.
The code I use to connect to the DB is this one, if I remove it pages load correct, except that there is no DB connected. The DBHOST,DBUSER,DBPASS,DBNAME are all correct on live server as well:
$db = ADONewConnection('mysql');
$db->Connect(DBHOST,DBUSER,DBPASS,DBNAME) or die("Database not found! please install your application properly");
Also, all files in ADONewConnection library are fine, so it should be some setting on the live server that is different from Xampp and that I cannot think of.
I also tried this on another different hosting server and again no luck.
Any suggestions or ideas will be appreciated.

Ubb forum error Unable to connect to the database!

I have recently migrated my ubb forum website to a new web hosting server, I have placed the files on new server and I think directory structure is right and also set up the database through phpmyadmin, and changed config file accordingly but still I am getting this error
UBB Message We encountered a problem. The reason reported was
Script:
Line#:
SQL Error:
SQL Error #:
Query: Unable to connect to the database!
I think all the info that i have filled in config file here:
'DATABASE_SERVER' => 'db.aa.0000000.hostedresource.com',
'DATABASE_USER' => 'abcd',
'DATABASE_PASSWORD' => 'cccc',
'DATABASE_NAME' => 'ssddd',
is correct because I tried to connect to db through another script and it did work and retrieved the data so I am totally confused what I am doing wrong.
Are you sure that this is the correct configuration data? Did you perhaps copy it into your config file wrong? That would seem to be the most likely source of errors (e.g. the script that worked had similar, but slightly different values which were actually correct and on first blush look like the ones in your config file).

Categories