1. ### **下載PHP7.3源碼**
```
[root@local ~]# cd /home/
[root@local ~]# wget http://cn2.php.net/distributions/php-7.3.3.tar.gz
```
2. ### **解壓**
```
[root@local ~]# tar -zxvf php-7.3.3.tar.gz
```
3. ### **編譯安裝**
```
[root@local ~]# cd php-7.3.3
[root@local ~]# ./configure --prefix=/www/server/php/73
[root@local ~]# make
[root@local ~]# make install
```
安裝路徑可通過--prefix=自定義
4. ### **設置環境變量**
修改/etc/profile文件使其永久性生效,并對所有系統用戶生效,在文件末尾加上如下代碼
```
PATH=$PATH:/www/server/php/73/bin export PATH
```
最后:執行 命令source /etc/profile或 執行點命令使其修改生效;
執行完可通過echo?$PATH命令查看是否添加成功。
```
[root@local ~]# source /etc/profile
[root@local ~]# echo?$PATH
```
5. ### **配置php.ini文件**
查看php.ini 配置地址,然后把php.ini-development復制到對應目錄下并命名為php.ini
```
[root@local ~]# php -i |grep php.ini
[root@local ~]# cp php.ini-development /www/server/php/73/lib/php.ini
```
*****
### **注:安裝依賴**
如果安裝過程中失敗,需要安裝依賴 gcc、libxml2、autoconf
```
[root@local ~]# yum install gcc-c++
[root@local ~]# yum install libxml2-devel
[root@local ~]# yum install autoconf
```
- 序章
- 1.環境搭建
- PHP7源碼編譯安裝
- Swoole源碼編譯安裝
- Mysql5.7源碼安裝
- Redis安裝
- 2.搭建Echo服務器
- 3.Server服務器
- 函數列表
- Server::__construct
- Server->set
- Server->on
- Server->start
- Server->send
- WebSocket
- Server->push
- Server->exist
- Server::pack
- Server::unpack
- Server->disconnect
- Server->isEstablished
- 配置選項
- reactor_num
- worker_num
- max_request
- max_conn
- daemonize
- backlog
- log_file
- log_level
- upload_tmp_dir
- http_parse_post
- document_root
- http_compression
- 事件回調函數
- onStart
- onWorkerStart
- onConnect
- onReceive
- onPacket
- onRequest
- 請求Request
- Http\Request->$header
- Http\Request->$server
- Http\Request->$get
- Http\Request->$post
- Http\Request->$cookie
- Http\Request->$files
- Http\Request->rawContent
- Http\Request->getData
- 響應Response
- Http\Response->header
- Http\Response->cookie
- Http\Response->status
- Http\Response->redirect
- Http\Response->write
- Http\Response->sendfile
- Http\Response->end
- Http\Response->detach
- Http\Response::create
- onClose
- onOpen
- onMessage
- 創建服務器
- TCP服務器
- UDP服務器
- HTTP服務器
- WebSocket服務器
- 4.定時器Timer
- 5.進程Process
- Process::__construct
- Process->start
- Process->name
- Process->exec
- Process->write
- Process->read
- Process->setTimeout
- Process->setBlocking
- Process->useQueue
- Process->statQueue
- Process->freeQueue
- Process->push
- Process->pop
- Process->close
- Process->exit
- Process::kill
- Process::wait
- Process::daemon
- Process::signal
- 6.內存Memory
- Table
- Table->__construct
- Table->column
- Table->create
- Table->set
- Table->incr
- Table->decr
- Table->get
- Table->exist
- Table->count
- Table->del
- Channel
- Channel->__construct
- Channel->push
- Channel->pop
- Channel->stats
- 7.協程Coroutine
- Coroutine
- Coroutine::list
- Coroutine::set
- Coroutine::stats
- Coroutine::create
- Coroutine::exist
- Coroutine::getCid
- Coroutine::getContext
- Coroutine::defer
- Coroutine::getBackTrace
- Coroutine::yield
- Coroutine::resume
- Coroutine::fread
- Coroutine::fgets
- Coroutine::fwrite
- Coroutine::sleep
- Coroutine::gethostbyname
- Coroutine::getaddrinfo
- Coroutine::exec
- Coroutine::readFile
- Coroutine::writeFile
- Coroutine::statvfs
- Coroutine::getPcid
- Coroutine\Channel
- Coroutine\Channel->__construct
- Coroutine\Channel->push
- Coroutine\Channel->pop
- Coroutine\Channel->stats
- Coroutine\Channel->close
- Coroutine\Channel->length
- Coroutine\Channel->isEmpty
- Coroutine\Channel->isFull
- Coroutine\Channel->$capacity
- Coroutine\Channel->$errCode
- Coroutine\Client
- Coroutine\Client->connect
- Coroutine\Client->send
- Coroutine\Client->recv
- Coroutine\Client->close
- Coroutine\Client->peek
- Coroutine\Client->set
- Coroutine\Http\Client
- Coroutine\Http\Client->get
- Coroutine\Http\Client->post
- 其他
- 并行和并發的區別
- 堆、棧、隊列