使用mysqli ini_set [英] working with mysqli ini_set

查看:60
本文介绍了使用mysqli ini_set的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经接管了另一个开发人员创建的设置,并且对该设置行不熟悉.有人可以澄清这一行代码吗?

ini_set ( 'mysqli.default_socket' , '/tmp/mysql5.sock' );

解决方案

ini_set()更改运行时配置值,以覆盖/etc/php.ini中的值.

mysqli选项通过 mysqli扩展控制MySQL数据库的使用.

default_socket是mysqli扩展的运行时配置选项之一. /p>

default_socket的含义是套接字文件"的路径名,该文件用于PHP应用程序和MySQL服务器之间的本地访问.也就是说,仅当您的PHP应用程序在连接到MySQL时使用"localhost"作为主机名时,才使用套接字.有关更多信息,请阅读 http://dev.mysql.com/doc/refman/5.6/en/connecting.html

如果/etc/php.ini中的值与该服务器上MySQL实例创建的套接字文件的位置不匹配,则有必要为default_socket指定一个值.

I've taken over a set up created by another developer and am unfamiliar with this line of set up. Could someone clarify this line of code?

ini_set ( 'mysqli.default_socket' , '/tmp/mysql5.sock' );

解决方案

ini_set() changes a runtime configuration value, to override the value that is in /etc/php.ini.

The mysqli options control usage of the MySQL database with the mysqli extension.

default_socket is one of the runtime configuration options for the mysqli extension.

The meaning of default_socket is the pathname of a "socket file" which is used for local access between the PHP application and the MySQL Server. That is, the socket is used only if your PHP application uses "localhost" as the hostname when connecting to MySQL. For more information, read http://dev.mysql.com/doc/refman/5.6/en/connecting.html

It would be necessary to specify a value for default_socket if the value in /etc/php.ini doesn't match the location of the socket file created by the instance of MySQL on this server.

这篇关于使用mysqli ini_set的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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