linux編譯安裝php

2021-08-14 21:57:48 字數 870 閱讀 2089

2,tar -xzvf php-5.6.33.tar.gz #解壓

3,cd php-5.6.33

4,./configure --prefix=/usr/local/php56 --with-config-file-path=/usr/local/php56/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-mysql --with-mysqli --with-pdo-mysql --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline

#配置編譯環境,當中可能會出錯,但別擔心,報錯的基本是告訴你哪些依賴沒安裝,根據錯誤資訊去安裝相應的依賴包就可以了,如果一切順利,出現"thanks use php",就可以開始第5步了。

5,make && make install #編譯並安裝php,如果成功你就可以看到目錄/usr/local/下多了php56,如果沒看到說明安裝失敗了,輸入make clean && make clean all,重新從第4步安裝。

6,根據使用的伺服器nginx/apache作相應配置即可。

Linux編譯安裝php擴充套件

進入解壓後的php原始碼包目錄 cd usr local src php 7.2.7 然後再進入到裡面的ext目錄裡面對應的擴充套件目錄 這裡我列出自己編譯過的擴充套件 安裝好之後,需要到php.ini檔案裡面開啟對應的擴充套件 phpize找不到的話,用find查詢一下phpize,用絕對路徑 p...

linux 下編譯安裝php

系統環境 wget tar xf php 5.5.9.tar.bz2 c usr local src 新增 epel 源 rpm uvh 安裝依賴 yum install gcc bison bison devel zlib devel libmcrypt devel mcrypt mhash de...

linux下編譯安裝php擴充套件

今天部署我的部落格時出現了幾個問題 1.undefined class constant mysql attr init command 2.call to undefined function home controller curl init 這才發現我安裝的php7忘裝了pod mysql和c...