Code igniter application error - php

I got this error while i was installing a Codeigniter application in my Cpanel. The strange thing is it is working very well in my localhost but not in my Cpanel.
And I updated all the required fields with apt credentials..
Error
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 346

Related

CodeIgniter Database Error but only one section of app

I have an existing web app but for no apparent reason one section of the app is now displaying the following error:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 338
The rest of the app works fine and can connect using the same database credentials at application/config/database.php
Any help to point me in the right direction in terms of debugging the issue would be welcome.
This is for an existing Linux server, running MySQL 5, PHP 7 and Apache 2.
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/Loader.php
Line Number: 338

How can I set a web server directory for an extension_dir in php.ini?

Currently I am doing a web based PHP project which is connected with SQL Server with sqlsrv method in php. The frame work is CI, and I use php_pdo_sqlsrv_56_ts.dll extension to connect the SQL Server like (extension=php_pdo_sqlsrv_56_ts.dll) in php.ini. It works in my local client without any issue.
But I needed to host the web site in my shared web server, the SQL Server is already connect with an IP address.
How can I do this?
I tried in below method, but it gives error:
method 01
I uploaded all the dll files in web server and I changed the extension_dir as
extension_dir=http://example.uk/myweb/sqlsrv_dll_files/
method 02
I uploaded all the dll files in web server and I set the extension path as
extension=http://example.uk/myweb/sqlsrv_dll/php_pdo_sqlsrv_56_ts.dll
But this gives below error:
Fatal error: Call to undefined function sqlsrv_connect() in C:\xampp_v5\htdocs\web_project\system\database\drivers\sqlsrv\sqlsrv_driver.php on line 144
A PHP Error was encountered
Severity: Error
Message: Call to undefined function sqlsrv_connect()
Filename: sqlsrv/sqlsrv_driver.php
Line Number: 144
Backtrace:
Please advice me to rectify this error.
Thanks in advance,

mysql error mysqli_real_connect()

I have a Wordpress site that started receiving an error when I hit the homepage. The error is:
Warning: mysqli_real_connect(): (HY000/2002): Only one usage of each socket address (protocol/network address/port) is normally permitted. in D:\home\site\wwwroot\wp-includes\wp-db.php on line 1538
I was able to get it back up after I created a new db and restored from backup but after a few minutes I started getting the error again. The site is hosted in Azure and the mysql db is hosting cleardb. Any help you can provide as to why I am getting this error would be helpful. I have updated Wordpress to the latest version and updated php to version 7 but that did not fix the error. Any body point me in the right direction?

CodeIgniter database error when opening the website

The website works fine for a while but in a few days returns this error :
A PHP Error was encountered
Severity: Warning
Message: mysqli::real_connect(): (HY000/2002): Can't connect to local
MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
Filename: mysqli/mysqli_driver.php
Line Number: 202
Backtrace:
File: /var/www/html/application/controllers/Login.php Line: 8
Function: database
File: /var/www/html/index.php Line: 289 Function: require_once
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/CodeIgniter.php
Line Number: 500
Help will be appreciated
Thanks
Nipun
Three things possible. Your database has been shut down (or it has died). You have not setup database to use a unix socket when both client and server are on the same machine. Or socket is not readable and writable by web user.
The warning is being thrown by mysqli driver. I would recommend that you use PDO driver to connect to the Database.It's simpler and a bit universal (You don't need to change Database settings once you change the DB)
you need confirm the database config file:application/config/database.php ensure the confirm item is correct
Please check your mysql server connectivity
If you run the app using your pc name i.e.
sahil-pc/recruitement or http://85.215.963.104:81/recruitement
you need to define it in index.php of root.
please check the permission of your db socket if you are using linux you need to make it in read and write mod.
note: ip details are fake don't try it

Trouble uploading a codeigniter website to the ftp

I have been trying to upload a codeigniter website but for some reason it shows errors i do not have on my local environment. These errors popped up after i uploaded the files:
A PHP Error was encountered
Severity: Warning Message: Cannot modify header information - headers
already sent by (output started at
[basepath]/application/config/constants.php:1)
Filename: core/Common.php
Line Number: 568
404 Page Not Found
The page you requested was not found.
A PHP Error was encountered
Severity: Core Warning
Message: PHP Startup: Unable to load dynamic library
'/opt/alt/php56/usr/lib64/php/modules/ioncube_loader.so' -
/opt/alt/php56/usr/lib64/php/modules/ioncube_loader.so: cannot open
shared object file: No such file or directory
Filename: Unknown
Line Number: 0
I have changed the database settings so that it would connect to the online database. I also followed the correct guide which suggested which setting to change to be able to access the files on the new server. I am however pestered by errors which seem to come from codeigniter's own files.
Has anyone encountered any of there errors, or can anyone make sense of them? Help would really be appreciated!
Your error occurs due to Ioncube security extension website.
As far as i know, this error could be caused by unsupported version of PHP. You have installed PHP 5.6 and Ioncube may still not support it. You should upgrade your ioncube extension or downgrade PHP.

Categories