php5.4以前的版本在安裝時,還有dbase可以直接選取extensions,之後就已經無法設定,
php7 可以改用pecl install dbase。
那PHP5.6該如何解決無法裝使用dbase的問題呢?
1.在pecl的網站:https://pecl.php.net/package/dbase
下載dbase的5.1.0的source檔,或由此連結下載
https://pecl.php.net/package/dbase/5.1.0
#cd /tmp
#fetch https://pecl.php.net/package/dbase/5.1.0
#tar zxvf dbase-5.1.0.tgz
#cd dbase-5.1.0
#phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
# ./configure
----------------------------------------------------------------------
Libraries have been installed in:
/tmp/dbase-5.1.0/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
#make test
Build complete.
Don't forget to run 'make test'.
=====================================================================
PHP : /usr/local/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.6.38
ZEND_VERSION: 2.6.0
PHP_OS : FreeBSD - FreeBSD tp.sa.tabdw.com.tw 12.0-RELEASE FreeBSD 12.0-RELEASE GENERIC amd64
INI actual : /tmp/dbase-5.1.0/tmp-php.ini
More .INIs :
CWD : /tmp/dbase-5.1.0
Extra dirs :
VALGRIND : Not used
=====================================================================
TIME START 2024-06-21 15:51:34
=====================================================================
No tests were run.
#make install
Installing shared extensions: /usr/local/lib/php/20131226-zts/
此時安裝程式已經將dbase.so複製到/usr/local/lib/php/20131226-zts/目錄下了
接下來新增extensions至ini
#cd /usr/local/etc/php
找一個檔案複製成dbase.ini
#cp ext-20-dba.ini dbase.ini
#ee dbase.ini
將原:extension=XXXX.so改為:extension=dbase.so
存檔,重啟apache24
/usr/local/etc/rc.d/apache24 restart
再查看phpinfo();是否能出現dbase5.1