2011年5月19日 星期四

Compiling Dbase extension for PHP in Ubuntu

由於dbase extension己經沒有在開發,所以在PHP 5.3.x之後就被移除,因此若要使用dbase必需自己compile.

1.Get the Source code, Subversion, and Tools
sudo apt-get install shtool dpkg-dev subversion

2.Get the source for dbase extension
cd ~
mkdir php
cd php
sudo apt-get source php5

3. Get the dbase source from SVN
cd php5-5.x.x/ext/
mkdir dbase
svn co http://svn.php.net/repository/pecl/dbase/trunk dbase

4.Compile the Extension
cd dbase
phpize
./configure
make

5.Copy the extension
sudo cp modules/dbase.so /usr/lib/php5/20090626+lfs/

6.Configure the PHP
sudo vim /etc/php5/apache2/php.ini
adding the line "extension=dbase.so" to the Section "Module Settings"

7.Restart Apache
sudo service apache2 restart

Install Apache+PHP+MySQL+phpMyAdmin on Ubuntu

1. Install Apache:
sudo apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils
2. Install PHP:
sudo apt-get install php5 libapache2-mod-php5 php5-common php5-gd php5-mysql php5-imap php5-cli php5-cgi php-pear php-auth
3. Install MySQL:
sudo apt-get install mysql-server mysql-client
這裡需要輸入mysql的root密碼

4. Install PhpMyAdmin:
sudo apt-get install phpmyadmin
這裡會做一些phpmyadmin的設定

5. Now your server is ready. Before you test please make sure to restart the server:
sudo service mysql restart
sudo service apache2 restart

6.資料庫預設目錄:/var/lib/mysql
網頁預設目錄:/var/www
Apache設定檔:/etc/apache2/apache2.conf
PHP設定檔:/etc/php5/apache2/php.ini
phpmyadmin預設安裝目錄:/usr/share/phpmyadmin