php 不從新編譯 添加 ftp 模組

來源:互聯網
上載者:User
php 不重新編譯 添加 ftp 模組

以添加ftp模組為例子

進入源碼目錄

cd php-5.2.9/ext/ftp
#運行phpize產生configure

/usr/local/php529/bin/phpize

?

Configuring for:
PHP Api Version:???????? 20041225
Zend Module Api No:????? 20060613
Zend Extension Api No:?? 220060519

如果出現

Cannot find autoconf. Please check your autoconf installation and the? $PHP_AUTOCONF? environment variable is set correctly and then rerun this script.

?

則安裝以下2個包

?

# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# tar -zvxf m4-1.4.9.tar.gz
# cd m4-1.4.9/
# ./configure && make && make install
# cd ../
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure && make && make install

?

然後開始配置

#編譯,指定php-config,注意這裡的php-config,不是php.ini

./configure --with-php-config=/usr/local/php529/bin/php-config
#上面可以添加--enable-ftp,也可以不用添加

#編譯安裝

make && make install
cd modules/

ls

ftp.la ftp.so

#複製ftp.so到模組目錄

cp ftp.so /usr/local/php529/lib/php/extensions

?

#編輯php.ini檔案,指定PHP到哪個目錄讀模組

vi /usr/local/php529/etc/php.ini

extension_dir="/usr/local/php5/lib/php/extensions"
#Load模組
extension=ftp.so
#儲存退出

重啟apache
再用/usr/local/php/bin/php -m|grep ftp查看是否有ftp.so

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.