4873 Posts in 7260 Topics by 1471 members
|Go to End|
16 October 2012 at 4:25pm
It's been a while since I've done work on Silverstripe but I just found out that new installations require the PHP extension mysqli to be enabled. And with all the luck in the world, my hosting provider doesn't have it enabled for re-seller accounts, I was advised to get a VPS account.
Any workaround so I won't need MySQLi enabled? Any downsides as well?
17 October 2012 at 8:33am
One way would be to use a different kind of DB (PostGRESQL) or alternatively, have your MySQL database hosted on another server. Although, if you were going to do that, you would probably just host everything there?
Sorry I can't be more help. This happened to me once, about 5 years ago and I demanded the host support what I need. It turned out that I wasn't the first person to ask, and they actually did it.
If you can't use MySQLi, and you need it...it's not really a 'reseller' account. They should support your requirements.
Sorry I can't be much more help.
17 October 2012 at 8:38am Last edited: 18 October 2012 11:40am
Actually, it would also be possible to modify the framework. Maybe framework/model/MySQLDatabase.php. However MySQLi and MySQL are quite different, with MySQLi having more features, which may end up breaking things in SilverStripe.
17 October 2012 at 7:28pm
Really appreciate your reply Van.
Has MySQLi always been a requirement? I used to host silverstripe apps on the same host and never had any problems. I only encountered the issue when I tried to install 3.0.2. I might try other versions though, like 3.0.1 or 2.x to see if this is an isolated case.
If anyone else encountered the issue and found a work-around, please share! Thanks
18 October 2012 at 10:07am Last edited: 18 October 2012 10:10am
mysqli was introduced about a year ago, before 3.0 was released: https://github.com/silverstripe/sapphire/commit/6bf3f7ded400c925dd66df2c2612c095d447c7b0#model/MySQLDatabase.php
2.4.x still uses the old mysql functions, it was upgraded during the course of 3.0 development because the majority of shared hosts we found had enabled mysqli by default. PHP have also suggested that everyone switches to mysqli or PDO MySQL instead of the old functions because they are not actively maintained any longer.
Excerpt about the old mysql API taken from http://nz.php.net/manual/en/intro.mysql.php:
"This extension is not recommended for writing new code. Instead, either the mysqli or PDO_MySQL extension should be used. See also the MySQL API Overview for further help while choosing a MySQL API."
I would suggest to your host that they enable mysqli, especially considering PHP themselves recommend everyone use it over the old driver. For the most part, I don't see that being a problem for them, because mysqli will run happily alongside the old mysql drivers.
18 October 2012 at 5:48pm
Thanks for the clarity Sean. I guess the best move would be to persuade my host to have the extension enabled.
Appreciate all the help!
|Go to Top|