Dropkick config file query - help please

Firstly, I think Dropkick is a good thing - and the developer Michael has been very patient at trying to find a solution for me.

But unfortunately, my config.php file is not working on 2 of my 3 sites.
All files are uploaded to root directory including htaccess and config files.

I have uninstalled, reinstalled, made new config files, checked with my hosting people four times and they can’t see that I have made any mistakes either.

I have even tried to duplicate from the site it actually worked on to the new sites, and nothing works. On all three sites php is 5.4.

When I put the code into a code tester it tells me that two lines of code are deprecated in current php, but as I am a designer not a coder, I have no idea what that means.

The code base file to change is:

<?php //database details error_reporting(0); $host = 'localhost'; $user = 'username'; $password = 'password'; $database = 'database name'; R::setup('mysql:host='.$host.';dbname='.$database.'',''.$user.'',''.$password.''); $mysqliConnection = **mysqli**_connect($host, $user, $password); ?>

My hosting told me that the extra ‘i’ in the last line should be removed for my php. But that’s all.
$mysqliConnection = mysql_connect($host, $user, $password);

An example of my code is:

<?php //database details error_reporting(0); $host = 'mysql-6.domainname.com.au'; $dbname = 'data01_domainname_com_au'; $username = 'mydata1234'; $password = 'AeOfepAt'; R::setup('mysql:host='.$host.';dbname='.$database.'',''.$user.'',''.$password.''); $mysqliConnection = **mysql**_connect($host, $user, $password); ?>

I am at a loss to know what is not working.

Are there any coders who can shed some light on what I should be checking for?
Should there be double quotes instead of single quotes etc?

Thanks for any help.

Karen,

Suggest you remove or disguise your password (ending in ‘pAt’) in your post, just to be sure.

‘deprecated’ means that the syntax, statement or construct has been superseded by something more secure, elegant and/or efficient; and that the deprecated code is not guaranteed to work in future versions of… in this case PHP.

Also suggest correcting the syntax to:

$mysqlConnection = mysql_connect($host, $user, $password);

in that penultimate line.

I don’t know Dropkick or PHP well enough to know what’s going on.

Does the R:: imply RedBean PHP?

If so, is there any documentation there that related error code to possible cause(s)?

Maybe quote here the errors you get and what happens; and see if a PHP specialist can address your probs.

You could also try calling your connection with literals (the actual values for host, db, user and password) instead of those variables from the line above.

Could it be permissions: has the same user got access to the SQL Database?

Have you actually set the database up and configured it?

If not, suggest starting from scratch and doing that - and not importing code from other sites… they’re almost certain to be configured differently.

Good luck!

Thanks Mark

re password - that’s a made up one for this forum only. :smile: Not the actual one.

I will try correcting that line and see if that works.

Dropkick is made by Yuzool Themes. It’s a very simple and easy to use cms which keeps the Rapidweaver styles but lets the client edit their text, which is why I want to use it.

Yes, I set up the database by logging into my hosting account. I have tried a couple of different database names, just in case.

Will post results here.

Thanks so much for replying.

Karen,

Sorry you’re having this trouble; I wish I knew more and could help.

Always suggest stripping everything back down to a basic which works; then adding in elements one by one until you find the one that doesn’t.

Have you asked your host to show you how to look at the PHP error logs; they are likely to be illuminating?

Pls do post back here with your progress :slight_smile: !

@MarkSealey just updating - no progress I’m afraid. Michael from Yuzool has been working on it testing and my hosting people have investigated. It just doesn’t work on our hosting servers and we don’t know why. It’s very weird. There is no real reason why it shouldn’t and I have tried it on 4 separate websites. Michael is still trying but it’s got me beat. It works for everyone else who has posted about it.

@MarkSealey The hosting company just confirmed to me it’s because of a problem with cloud hosting and any other CMS. They need to be on C-panel hosting, not cloud hosting. It’s not Dropkick, but the hosting that is the problem.

Apparently, ‘After a few tests I can confirm that the plugin will not work on our cloud hosting
The error is the mysqli.max_links on cloud hosting is set as 1 and the plugin requires more the one.
On Cpanel it is currently set as unlimited, so it should work on Cpanel hosting.’

The host provider will let me know if the hosting changes in the future to allow more than one mysquli.max_links on cloud hosting.

Progress! Good luck, Karen…

Can I ask who the hosting company is/was? I am having the same issue with config.php. using mySQLWorkbench connects fine with the same connection details but attempting to run the install continually tells me there is an issue connecting to the database.

regards
John

Thanks @jminogue
Please make sure you don’t have any curly quotes in the config.php :sunglasses:

https://www.yuzoolthemes.com/support/article/view/stacks/dropkick-cms-keeps-showing-the-an-error-to-connect-to-the-database