這兩天架了一台Cent OS7的主機,我發現變化有點大。還好透過Google大神幫助找到幾篇文章,終於協助我將網站架設起來,並且啟動個人網站。
安裝重點可以參考
1.http://myip.tw/itsmw/index.php?title=CentOS7
重點是將SeLinux關閉
2.http://tech.hitsug.net/?CentOS-7%2FApache%2F%E8%A8%AD%E5%AE%9A
個人網站的開啟不再是透過http.conf
這篇資料提供設定的方式,調整後就可以正常運作
3.安裝webmin
這還是很重要的,另外CentOS7多了firewallD
透過這個來設定開放的Port
還有網路的設定必須啟動時就啟動網路設備
不然網路就不通了
Also see DSN-less connections with PHP.
What is ODBC?
Open DataBase Connectivity is an Application Programming Interface (API) that allows a programmer to abstract a program from a database. When writing code to interact with a database, you have to add code that talks to a particular database using a proprietary API. If you want your program to talk to an Access, FoxPro and Oracle databases you have to code your program with three different database API's. This can be quite the daunting task causing much grief. Now, enter ODBC...
When programming to interact with ODBC you only need to use the ODBC API (a combination of ODBC extension function calls and the SQL language) to talk to different database products. The ODBC Manager will figure out how to contend with the type of database you are targeting. Regardless of the database type you are using, all of your calls will be to the ODBC API. All that you need to do is have installed an ODBC driver that is specific to the type of database you will be using.
Creating A ODBC Data Source Name (DSN)
After you have ensured that the ODBC driver for your database is installed, you normally need to create a Data Source Name (DSN), which contains all the connection details required to login (accept maybe id and password).
Walkthrough: How to Setup a DSN. A pictorial step-by-step guide. The next button is hidden on the bottom-right. Sorry but we Windows programmers are not user interface experts ;-)
Connecting to ODBC
There is an excellent tutorial on using PHP's ODBC extension at ASPToday, a popular ASP web site.
An example taken from the above article:
# query the users table for name and surname $query = "SELECT name, surname FROM users";