PHP 入門學習

2021-09-24 17:58:46 字數 2430 閱讀 6136

(一)執行環境

1、lamp:linux apache mysql php

2、lnmp:lnmp nginx mysql php

(q:linux和window的對比)

(二)php基礎知識

1、基礎語法

2、物件導向

3、mvc

(二)mysql基礎知識

1、ddl(data definition languages)語句:資料定義語言,這些語句定義了不同的資料段、資料庫、表、列、索引等資料庫物件的定義。常用的語句關鍵字主要包括 create、drop、alter等。

2、dml(data manipulation language)語句:資料操縱語句,用於新增、刪除、更新和查詢資料庫記錄,並檢查資料完整性,常用的語句關鍵字主要包括 insert、delete、udpate 和select 等。(增添改查)

3、dcl(data control language)語句:資料控制語句,用於控制不同資料段直接的許可和訪問級別的語句。這些語句定義了資料庫、表、字段、使用者的訪問許可權和安全級別。主要的語句關鍵字包括 grant、revoke 等。

(一)安裝配置wamp1、安裝路徑:

2、配置httpd.conf檔案:

(1)檔案路徑:wamp\bin\apache\apache2.4.9\conf\httpd.conf

(2)找到documentroot:

documentroot "e:/wamp/www/"改為自己的專案路徑,專案必須部署在這個路徑目錄下才有效,否則apache沒有許可權訪問;如d:\webroot

(3)去掉右邊行前面的#,讓apache支援多站點配置 :include conf/extra/httpd-vhosts.conf

(4)將所有的allowoverride none改為allowoverride all

(5)將所有的require all denied改為require all granted

3、配置httpd-vhosts.conf檔案:

(1)檔案路徑:d:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf

(2)配置路由:

serveradmin [email protected]    //不用改

documentroot "d:\3.webroot\***\trunk" //想要執行的那個專案的路徑,可自定義

servername www.***xx.cn //給專案配置乙個本地的網域名稱,可自定義,用於本地測試時,開啟該**就可以看到效果

errorlog "d:\3.webroot\***x\dummy-host2.example.com-error.log"

customlog "d:\3.webroot\***x\dummy-host2.example.com-access.log" common

(二)安裝配置switchhosts(三)安裝配置sqlyog2、新建連線:

3、新建乙個資料庫,基字元集合資料庫排序規則如下:

2、把想要執行的專案資料庫匯入進剛剛新建的資料庫裡

4、開啟專案連線資料庫的配置檔案mysql.php,修改如下:

(四)測試

1、重啟wamp

2、輸入**www.***x.cn測試是否能正常顯示

一、鏈結路徑後面出現/install安裝嚮導

解決:在data路徑下新建乙個文字文件,命名為install.lock

三、介面寫法:

api.php?ac=index_***

PHP入門學習1

php的語法。1 嵌入方法 類似asp的 php可以是,當然您也可以自己指定。2 引用檔案 引用檔案的方法有兩種 require 及 include。require 的使用方法如 require myrequirefile.php 這個函式通常放在 php 程式的最前面,php程式在執行前,就會先讀...

php入門學習 介面

介面 使用inte ce關鍵字,可以指定某個類的方法但不必實現 inte ce people public function getname public function getage 介面實現類必須,實現介面中的方法 public class man implements people 實現介面...

php入門學習 抽象

抽象類 使用關鍵字abstract abstract pepole abstract public function getname 抽象方法 abstract public function getage public function get 非抽象方法 return class man ext...