I found that PHP is rarely used in traditional enterprises (enterprises that use MSSQL and ORACLE databases. Recently, a project needs to deploy the PHP system in both the development and production environments. With PDO objects, you need to access MYSQL, MSSQL, and ORACLE Data... I found that PHP is rarely used in traditional enterprises (enterprises that use MSSQL and ORACLE databases.
Recently, a project needs to deploy the PHP system in both the development and production environments. With PDO objects, you need to access MYSQL, MSSQL, and ORACLE databases.
How can I implement it? Use the PHP PDO configuration on mac, windows, and windows server to access these databases? Mssql has a minimum version of 2005 and is currently used in the xampp integrated environment.
If not, only change to. net...
__
Sorry, maybe I didn't make it clear.
I tried it in the php manual and enabled extension = php_mssql.dll and extension = php_pdo_mssql.dll, but no matter how to use $ dsn = "mssql: host = 10.1.1.1; dbname = test "; or $ dsn = "dblib: host = 10.1.1.1; dbname = test ";.
When new pdo is added, the following error occurs: Uncaught exception 'pdoexception' with message 'could not find driver '.
I saw in phpinfo that pdo drivers only contains mysql, pgsql, and sqlite. I guess it may be because the mssql for pdo driver does not exist, but only for windows is found.
At the same time, I can see that FreeTDS is used in mac (he didn't say that xampp is still an environment), but I need xcode and another component and need to compile it. I just thought, is there no more concise method?
Therefore, I want to give you a complete question. I hope that experts who have practice in this area can systematically answer this question, at the same time, it is also convenient for the search engine to guide sf (because I found that the search engine has a very fast indexing rate for sf). Who else will find similar problems, you don't have to try it out, because it takes a lot of time and effort and you can't learn anything.
Reply content:
I found that PHP is rarely used in traditional enterprises (enterprises that use MSSQL and ORACLE databases.
Recently, a project needs to deploy the PHP system in both the development and production environments. With PDO objects, you need to access MYSQL, MSSQL, and ORACLE databases.
How can I implement it? Use the PHP PDO configuration on mac, windows, and windows server to access these databases? Mssql has a minimum version of 2005 and is currently used in the xampp integrated environment.
If not, only change to. net...
__
Sorry, maybe I didn't make it clear.
I tried it in the php manual and enabled extension = php_mssql.dll and extension = php_pdo_mssql.dll, but no matter how to use $ dsn = "mssql: host = 10.1.1.1; dbname = test "; or $ dsn = "dblib: host = 10.1.1.1; dbname = test ";.
When new pdo is added, the following error occurs: Uncaught exception 'pdoexception' with message 'could not find driver '.
I saw in phpinfo that pdo drivers only contains mysql, pgsql, and sqlite. I guess it may be because the mssql for pdo driver does not exist, but only for windows is found.
At the same time, I can see that FreeTDS is used in mac (he didn't say that xampp is still an environment), but I need xcode and another component and need to compile it. I just thought, is there no more concise method?
Therefore, I want to give you a complete question. I hope that experts who have practice in this area can systematically answer this question, at the same time, it is also convenient for the search engine to guide sf (because I found that the search engine has a very fast indexing rate for sf). Who else will find similar problems, you don't have to try it out, because it takes a lot of time and effort and you can't learn anything.
For Windows PHP, the Oracle driver is built in the ext directory:
Php_oci8.dll
Php_oci8_11g.dll
Php_pdo_oci.dll
In Linux, add the following configure configuration items, for example:
-- With-oci8 = shared, instantclient,/usr/lib/oracle/11.2/client/lib
-- With-pdo-oci = shared, instantclient,/usr/lib/oracle, 11.2
Oracle Instant Client (60 MB ):
Http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
SQL Server Driver for PHP (php_sqlsrv.dll and php_pdo_sqlsrv.dll, Windows only ):
Http://www.microsoft.com/en-us/download/confirmation.aspx? Id = 20098
You can use unixODBC + FreeTDS to access SQL Server on Linux.
FreeTDS: The driver used to connect SQL Server and Sybase in UNIX/Linux.
-- With-pdo-dblib = dir pdo: DBLIB-DB support. DIR is the FreeTDS home directory
UnixODBC is a data source Manager that manages data source names created by various data drivers.
FreeTDS is a free SQL Server/Sybase driver in UNIX/Linux systems,
You can create a data source name by using unixODBC to access the data.
So PHP is simple to use MySQL, because the MySQL driver mysqlnd is built in the PHP source code, and mysqli/pdo_mysql support is provided based on mysqlnd. Of course, PHP also has built-in SQLite engine.
Http://php.net/manual/zh/ref.pdo-oci.php
Http://php.net/manual/zh/ref.pdo-dblib.php
In fact, what I want to talk about is php compilation, which is troublesome. I usually choose an integrated environment, which is basically a context menu check.
@ Murmur the first few of google's solutions are basically on stackoverflow. I also probably browsed them. Basically, they all replied like you: throwing a php.net link or a Microsoft-driven link.
Maybe I don't understand English. I can't understand it. If I have good English, I won't be able to use segmentfault.
Haha.