2011-09-21 51 views
3

我試圖在Ubuntu 11.04上安裝PHP。我從源代碼編譯。在Ubuntu上安裝支持IMAP/Kerberos的PHP的問題11

下面是我安裝的依賴:

apt-get -y install php5-dev php-pear 
apt-get -y install libxml2-dev libevent-dev zlib1g-dev libbz2-dev libgmp3-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libgd2-xpm-dev libmcrypt-dev memcached libmemcached-dev libc-client-dev libkrb5-dev 

這裏是我的配置腳本:

./configure --enable-fpm --enable-cli --with-fpm-user=php-fpm --with-fpm-group=php-fpm --prefix=/usr/local/php --exec-prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/etc --enable-bcmath --enable-ctype --with-curl --with-curlwrappers --enable-dba --with-cdb --with-flatfile --with-inifile --enable-exif --enable-ftp --disable-fileinfo --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-ttf --with-freetype-dir --enable-gd-native-ttf --with-gettext --with-gmp --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --enable-mbstring=all --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-pdo-mysql --with-openssl --with-kerberos --with-pspell --enable-shmop --enable-simplexml --with-snmp --enable-soap --enable-sockets --with-tidy --enable-wddx --enable-xmlreader --with-xmlrpc --with-xsl --with-zip --with-zlib --enable-sysvsem --enable-sysvshm 

但是,我得到一個錯誤:

configure: error: Kerberos libraries not found. 

    Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr) 

我沒有提供一個路徑,但在我的系統上沒有像/ usr/kerberos這樣的目錄。在錯誤之上大約五行處有一個日誌項,表示checking for IMAP Kerberos support... yes

我需要指定一個目錄爲--with-kerberos,這個目錄是什麼?我整天都在這裏,似乎無法弄清楚。

在此先感謝。

編輯:

我能出一個符號鏈接排序這個問題。

以下是您在運行configure命令之前執行的操作。

mkdir /usr/kerberos 
ln -s /usr/lib/x86_64-linux-gnu /usr/kerberos/lib 

乾杯。

回答

3

我正在處理問題安裝PHP 5.3.8來自Ubuntu 11.04的源代碼。我用的是:

./configure '--with-libdir=lib64' '--with-mysql=/usr' '--with-curl' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--with-mhash=shared' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir' '--with-freetype-dir' '--with-mcrypt' '--with-mysqli' '--enable-gd-native-ttf' '--enable-calendar' '--enable-ftp' '--with-openssl' '--enable-pcntl' '--enable-soap' '--enable-sockets' '--enable-spl' '--enable-tokenizer' '--enable-wddx' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-config-file-path=/usr/local/apache/conf' 

,並得到同樣的錯誤:

configure: error: Kerberos libraries not found. 

檢查給--with-的Kerberos(路徑,如果未指定路徑,查找在/ usr/Kerberos的,/ usr/local和/ usr)

我意識到我的kerberos安裝文件與/ usr/lib/x86_64-linux-gnu非常不同。我嘗試了建議的「--with-kerberos =/usr/lib/x86_64-linux-gnu」,但正如其中一個鏈接頁面所示,搜索會自動將「lib」添加到所提供路徑的末尾。

如上所述,鏈接到此處的其他頁面之一討論了腳本自動將「lib」添加到路徑上(因此,如果沒有指定路徑,它會查找/ usr/kerberos/lib,/ usr/local/lib ,和/ usr/lib),但我沒有意識到的是,如果你使用「--with-libdir = lib64」,這個腳本實際上會尋找/ usr/kerberos/lib64,/ usr/local/lib64 ,/ usr/lib64)。

在意識到這一點之後,我創建了以下符號鏈接,並且在沒有指定kerberos路徑的情況下再次嘗試。

mkdir -p /lib/kerberos 
ln -s /usr/lib/x86_64-linux-gnu/ /usr/kerberos/lib 
ln -s /usr/lib64/x86_64-linux-gnu/ /usr/kerberos/lib64 

這對我有效。希望它可以幫助別人。

+0

非常感謝凱文。我實際上已經整理了這個問題,並忘了更新它。我現在要做。乾杯。 –

0

您是否嘗試使用Google搜索錯誤消息? This page似乎有一個可行的解決您的問題。我檢查了我的系統,發現Kerberos庫安裝在/ usr/lib64。因此,我將-with-kerberos =/usr/lib64傳遞給configure腳本,但腳本仍然報告Kerberos庫找不到「

」從填充我的終端的輸出頁面,我發現configure腳本將「lib」附加到我提供的-with-kerberos路徑中,所以它在非內部「/ usr/lib64/lib」目錄,但是我發現我可以通過將-with-libdir = lib64傳遞給configure腳本來將「lib」更改爲「lib64」。「

+0

是的,我一直在這個特定的頁面(多個Google後),並嘗試了建議,但它沒有奏效。我嘗試了/ usr/lib64,/ usr/lib,/ usr/include,/ usr/include/krb5以及其他一兩個,但沒有成功。我不確定這個問題到底是什麼。 –

+0

你試過'--with-kerberos'而不是'-with-kerberos'嗎?我不確定這是否是網頁上的拼寫錯誤。使用這些選項之一調用腳本時,「檢查​​給予--with-kerberos的路徑」錯誤會消失嗎?另外,你的kerberos庫安裝在哪裏?您可以執行dpkg -L packageName來查詢屬於包的文件的位置。另外,你能否詳細說明「它沒有用」的含義? – Anson

+0

好吧,通過「它沒有工作」,這意味着我編譯時遇到同樣的錯誤,而且我仍然處於我的位置。 -with-kerberos是一個錯字,我實際上把它當作--with-kerberos。無論我是否提供目錄,我都會收到錯誤。我試過'dpkg -L kerberos',我收到一條消息說「包kerberos沒有安裝」。這是否意味着我需要安裝它,並且你知道我該如何做到這一點? –

0

因爲我也有10.04這個錯誤,所以我決定粘貼我的解決方案。也許它有一天會幫助別人。清晰地運行彙編,我從--with-kerberos更改爲with-kerberos=shared,/usr/lib。看起來這是所有的魔術,因爲編譯器通過lib64忽略了這一點。