GVKun编程网logo

linux – 在CentOS 6.2中安装php-mssql(centos安装php5.6)

6

本文的目的是介绍linux–在CentOS6.2中安装php-mssql的详细情况,特别关注centos安装php5.6的相关信息。我们将通过专业的研究、有关数据的分析等多种方式,为您呈现一个全面的了

本文的目的是介绍linux – 在CentOS 6.2中安装php-mssql的详细情况,特别关注centos安装php5.6的相关信息。我们将通过专业的研究、有关数据的分析等多种方式,为您呈现一个全面的了解linux – 在CentOS 6.2中安装php-mssql的机会,同时也不会遗漏关于Docker mssql-server-linux:如何在构建期间启动.sql文件(来自Dockerfile)、linux php freetds mssql 2008 簡體 繁體 共存 採用 UTF-8、Linux PHP53升级PHP5533 linux php升级5.5 php5.2 for linux linux libphp5.s、linux – 在CentOS 4.4中,如何从文本文件中删除转义序列?的知识。

本文目录一览:

linux – 在CentOS 6.2中安装php-mssql(centos安装php5.6)

linux – 在CentOS 6.2中安装php-mssql(centos安装php5.6)

我有一台运行CentOS 6.2和Plesk 10.4的服务器.当我进入SSH并尝试安装ms-sql扩展时,它会说“没有包PHP-mssql可用”.

我似乎无法在Google上找到这么多,而且我有点像Linux菜鸟.有人可以提供任何帮助吗?

编辑:我尝试使用“yum install PHP-mssql”安装它

解决方法

PHP-mssql是在 EPEL.

Docker mssql-server-linux:如何在构建期间启动.sql文件(来自Dockerfile)

Docker mssql-server-linux:如何在构建期间启动.sql文件(来自Dockerfile)

我正在尝试使用MSsql DB创建自己的Docker镜像以进行开发.它基于microsoft / mssql-server-linux映像.在构建期间,我想将一些.sql文件复制到容器中,然后运行这些脚本(创建数据库模式,表,插入一些数据等).我的Dockerfile看起来像这样:

# use MSsql 2017 image on Ubuntu 16.04
FROM microsoft/mssql-server-linux:2017-latest

# create directory within sql container for database files
RUN mkdir -p /opt/mssql-scripts

# copy the database files from host to container
copY sql/000_create_db.sql /opt/mssql-scripts

# set environment variables
ENV MSsql_SA_PASSWORD=P@ssw0rd
ENV ACCEPT_EULA=Y

# run initial scripts
RUN /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'P@ssw0rd' -i /opt/mssql-scripts/000_create_db.sql

在我看来,000_create_db.sql的内容并不重要.

真正的问题是当我尝试使用命令docker build -t demo构建这个Dockerfile时.我总是得到这些错误:

sqlcmd: Error: Microsoft ODBC Driver 13 for sql Server : Login timeout expired.
sqlcmd: Error: Microsoft ODBC Driver 13 for sql Server : TCP Provider: Error code 0x2749.
sqlcmd: Error: Microsoft ODBC Driver 13 for sql Server : A network-related or instance-specific error has occurred while establishing a connection to sql Server. Server is not found or not accessible. Check if instance name is correct and if sql Server is configured to allow remote connections. For more information see sql Server Books Online..

但是当我删除最后一个命令(运行初始脚本)时,构建并运行图像,并调用相同的命令:

docker build -t demo .
docker run -p 1433:1433 --name mssql -d demo
docker exec -it mssql "bash"
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'P@ssw0rd' -i /opt/mssql-scripts/000_create_db.sql

一切都进展顺利.为什么我不能从Dockefile运行脚本?

从mssql-server-linux dockerfile看起来mssql是在docker run上启动的,所以你必须修改你的dockerfile中的最后一个“RUN”命令,在后台启动sql-server,运行你的sql文件并停止sql-服务器.

RUN /opt/mssql/bin/sqlservr --accept-eula & sleep 10 \
    && /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'P@ssw0rd' -i /opt/mssql-scripts/000_create_db.sql \
    && pkill sqlservr 

linux php freetds mssql 2008 簡體 繁體 共存 採用 UTF-8

linux php freetds mssql 2008 簡體 繁體 共存 採用 UTF-8

一般人都知道 mssql unicode 可以存什麼體,都 OK,

而你可以用 nvarchar 或者 nchar 就可以搞定!要不然數據庫裡,老是出現煩人的問號???

[環境介紹]

CentOS 6.x

(請全部 yum,php php-mssql freetds ....) 以下略

重點來了

請在 /etc/freetds.conf 改一下設定

tds version = 8.0   (不要懷疑,這個我找了好多參考,如果你採用 mssql 2000 以上,就用這個)

text size = 20971520  (這個大小不是重點,如果字數多,請調大)
client charset = UTF-8  (不用說,一定是 UTF-8)

當然可以自訂連線,不過我就省略了!!

好了,接下來的重頭戲,請確定以下幾件事情兒 >>>

一、是否網頁都存成 UTF-8

二、請用 mb_detect_encoding 去檢查,insert or update 的字串,是否為 UTF-8??

三、再檢查 select 出來之後的字串是否還是 UTF-8

OK, 如果你發現以上三點都正確,結果在數據庫裡顯現的還是?的話,那麼你要考慮以下的絕招了!

 update [資料表] set [欄位名稱]=N'' 应用推 '' where trade_no=''1111222333'';

對的,就是加個 N 就可以搞定,

我想,我哭了~搞太久了吧!!!!!

 

Linux PHP53升级PHP5533 linux php升级5.5 php5.2 for linux linux libphp5.s

Linux PHP53升级PHP5533 linux php升级5.5 php5.2 for linux linux libphp5.s

linux – 在CentOS 4.4中,如何从文本文件中删除转义序列?

linux – 在CentOS 4.4中,如何从文本文件中删除转义序列?

我可以使用什么命令从文本文件中删除颜色代码转义序列?理想情况下,我可以通过管道.如果我有一堆带有彩色文本的文件rainbow.txt,那么差距是多少:
cat rainBox.txt | *something* > plain.txt

我在CentOS 4.4上使用bash工作.

解决方法

尝试:
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"

今天关于linux – 在CentOS 6.2中安装php-mssqlcentos安装php5.6的讲解已经结束,谢谢您的阅读,如果想了解更多关于Docker mssql-server-linux:如何在构建期间启动.sql文件(来自Dockerfile)、linux php freetds mssql 2008 簡體 繁體 共存 採用 UTF-8、Linux PHP53升级PHP5533 linux php升级5.5 php5.2 for linux linux libphp5.s、linux – 在CentOS 4.4中,如何从文本文件中删除转义序列?的相关知识,请在本站搜索。

本文标签: