我可以使用MS SQL Server作为Joomla的后备数据库吗? [英] Can I use MS SQL Server as the backing database for Joomla?

查看:79
本文介绍了我可以使用MS SQL Server作为Joomla的后备数据库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Joomla是用PHP编写的开源CMS,最初基于Apache,MySQL和Linux.

Joomla is an open-source CMS written in PHP, that originally was based on Apache, MySQL, and Linux.

现在,它可以在IIS + Windows上运行.

Now it runs on IIS + Windows.

我可以使用MS SQL Server代替MySQL将其安装在Windows计算机上吗?

Can I install it on my Windows machine, using MS SQL Server instead of MySQL?

我见过一段视频,显示执行此操作的人.但是,当我下载joomla安装程序时,无法将其安装到MS SQL.

I have seen a video showing a person doing this. But when I download the joomla installer, it's not possible to install it onto MS SQL.

推荐答案

在使用joonla + SQL Server 一段时间后进行了编辑.

edited after having spent some time with joonla+SQL Server.

是的,您可以在SQL Server上运行joomla.但是有一些大的警告.

Yes, you can run joomla on SQL Server, sort of. But there are some big caveats.

  • 您必须下载修改后的joomla安装.我发现的最好的东西是Sudhi发布的经过修改的v1.6 joomla 来自Hooduku .直接链接是

  • You must download a modified joomla installation. The best I found was a modified v1.6 joomlaposted by Sudhi from Hooduku. The direct link is here. It's a one-off.

我没有找到支持SQL Server的joomla当前(v1.7)版本.

There's no current (v1.7) version of joomla supporting SQL Server that I found.

据我所知,并没有承诺对该产品进行持续维护.我查看了joomla发布计划,但没有将SQL Server支持视为承诺.

As far as I could tell there's no commitment to an ongoing maintenance of this thing. I looked in the joomla release plan and did not see SQL Server support as a commitment.

最后,可能最重要的是,它不起作用.

Lastly, and possibly most importantly, it does not work.

如何不起作用?让我来计算一下.

How does it not work? Let me count the ways.

joomla源代码中散布着一些查询,以检索模块名称,文章内容,等级等信息.大多数SQL代码适用于MySQL,而不适用于SQL Server. "multidb"修改版本修改最多吗?这些查询中的许多查询允许事物与SQL Server一起使用.但是,其中许多事情都被遗漏了.例如:我发现一个查询,现在无法回忆,它使用LENGTH来获取字符串的长度,而不是SQL Server函数LEN.这导致查询中断,并且无论我做什么,都没有发生.

There are queries scattered throughout the joomla source code, to retrieve things like module names, article content, ratings, and so on. Most of the SQL code works with MySQL, and not with SQL Server. The "multidb" modified version modifies most? many of those queries to allow things to work with SQL Server. But, many of those things were missed. For example: I found a query, cannot recall now, which used LENGTH to get the length of a string, instead of the SQL Server function LEN. This caused the query to break, and whatever I was trying to do, did not happen.

另一种情况(再次,我确切地忘记了何时发生)与插入行有关. joomla代码使用类似INSERT INTO table column1=4 column2=18的语法.实际上,现在我键入此内容时,我恰好记得该表-它是#__modules_menu表. 要插入的正确SQL Server语法INSERT INTO table (column1, column2) VALUES(4, 128).一个足够简单的更改,但是您需要仔细研究joomla的PHP代码以找出在哪里进行更改.

Another case (once again, I forget precisely when this occurred) had to do with inserting a row. The joomla code uses syntax like INSERT INTO table column1=4 column2=18. Actually now that I type this I recall precisely the table - it was the #__modules_menu table. The correct SQL Server syntax to insert a row is INSERT INTO table (column1, column2) VALUES(4, 128) . A simple enough change, but you need to skulk through joomla's PHP code to figure out where to make it.

还有其他许多错误弹出,大部分与格式错误的SQL语法有关.当一列实际上是一个字符串时,将其视为数字.为ORDER BY子句使用错误的表别名.

There were other myriad bugs that popped up, mostly having to do with malformed SQL syntax. Treating a column as a number, when it is actually a string. Using the wrong table alias for an ORDER BY clause.

我发现上载一个新模板 sort of 是可行的-模板已解压并被识别,没有错误报告.但无论出于何种原因,模板样式表均未得到更新,因此上传后该模板在管理面板中实际上并不可用.如果我在#__template_styles中手动插入一个条目,则该模板可用.

I found that uploading a new template sort of worked - the template was unpacked and recognized, no error reported. But the template styles table didn't get an update, for whatever reason, so the template was not actually available in the admin panels, after the upload. If I manually inserted an entry into #__template_styles, then the template became available.

我用过的特殊joomla下载标签上的名字说的是"RC1",但无论如何,它不是发行质量.

The name on the label of the special joomla download I used said "RC1" but it is not release quality, by any stretch of the imagination.

如果您尝试此操作,则还需要一堆其他先决条件.

If you try this, you will also need a bunch of other pre-requisites.

  • PHP of course. I used v5.3.6
  • the MS SQL Server drivers for PHP -- I grabbed the driver build for single-thread use, with the VC9 runtime. This needed to match my version of php. See below. I had to drop in php_sqlsrv_53_nts_vc9.dll and php_pdo_sqlsrv_53_nts_vc9.dll into the ext/ directory for PHP.
  • SQL Server or SQL Server Express (the free version). You may need to apply service packs.

PHPinfo页面显示VC运行时版本和线程安全参数

The PHPinfo page shows VC runtime version and thread safety params

这篇关于我可以使用MS SQL Server作为Joomla的后备数据库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆