2013-12-18 91 views
2

我在使用PHP訪問gettext時遇到問題。我的Mac Book Mac OSX 10.8 Mountain Lion作爲操作系統。我遵循的安裝說明如下。在Mac OSX上PHP gettext安裝失敗10.8

引用這個帖子:How to install gettext on MacOS X

#Install dependencies 
brew install libjpeg 
brew install pcre 
brew install libxml2 
brew install mcrypt 

#Get autoconf just because 
brew install autoconf 

#Install Intl extension 
#Install ICU 
#Download from http://site.icu-project.org/download/48#ICU4C-Download 
cd ~/Downloads 
tar xzvf icu4c-4_8_1-src.tgz 
cd icu/source 
./runConfigureICU MacOSX 
make 
sudo make install 

cd ~/Downloads/php-5.4.12/ext/intl 
phpize 
./configure --enable-intl 
make 
sudo cp modules/intl.so /usr/lib/php/extensions/no-debug-non-zts-20090626/ 

#Install gettext 
#Download from http://ftp.gnu.org/gnu/gettext/ 
cd ~/Downloads 
tar xzvf gettext-0.18.1.1.tar.gz 
cd gettext-0.18.1.1 
./configure 
make 
sudo make install 

cd ~/Downloads/php-5.4.12/ext/gettext 
phpize 
./configure 
make 
sudo cp modules/gettext.so /usr/lib/php/extensions/no-debug-non-zts-20090626/ 

#Add intl and get text to php.ini 
cd ~/Downloads/php-5.4.12 
nano php.ini-development 
#Add these lines 
extension=intl.so 
extension=gettext.so 

#Download PHP source files from php.net 
cd ~/Downloads 
tar xzvf php-5.4.12.tar.bz2 
cd php-5.4.12 

./configure \ 
--prefix=/usr \ 
--with-gettext \ 
--mandir=/usr/share/man \ 
--infodir=/usr/share/info \ 
--sysconfdir=/private/etc \ 
--with-apxs2=/usr/sbin/apxs \ 
--enable-cli \ 
--with-config-file-path=/etc \ 
--with-libxml-dir=/usr \ 
--with-openssl=/usr \ 
--with-kerberos=/usr \ 
--with-zlib=/usr \ 
--enable-bcmath \ 
--with-bz2=/usr \ 
--enable-calendar \ 
--with-curl=/usr \ 
--enable-dba \ 
--enable-exif \ 
--enable-ftp \ 
--with-gd \ 
--enable-gd-native-ttf \ 
--with-icu-dir=/usr \ 
--with-iodbc=/usr \ 
--with-ldap=/usr \ 
--with-ldap-sasl=/usr \ 
--with-libedit=/usr \ 
--enable-mbstring \ 
--enable-mbregex \ 
--with-mysql=mysqlnd \ 
--with-mysqli=mysqlnd \ 
--without-pear \ 
--with-pdo-mysql=mysqlnd \ 
--with-mysql-sock=/var/mysql/mysql.sock \ 
--with-readline=/usr \ 
--enable-shmop \ 
--with-snmp=/usr \ 
--enable-soap \ 
--enable-sockets \ 
--enable-sysvmsg \ 
--enable-sysvsem \ 
--enable-sysvshm \ 
--with-tidy \ 
--enable-wddx \ 
--with-xmlrpc \ 
--with-iconv-dir=/usr \ 
--with-xsl=/usr \ 
--enable-zip \ 
--with-imap=/usr/local/imap-2007 \ 
--with-kerberos \ 
--with-imap-ssl \ 
--enable-intl \ 
--with-pcre-regex \ 
--with-pgsql=/usr \ 
--with-pdo-pgsql=/usr \ 
--with-freetype-dir=/usr/X11 \ 
--with-jpeg-dir=/usr \ 
--with-png-dir=/usr/X11 

make test 
sudo make install 

#Restart Apache 
sudo apachectl restart 

的每一步似乎很好地工作,直到「做試驗」命令PHP .configure之後。

這裏是我得到的錯誤:

ibphp5.bundle libs/libphp5.so 
clang: error: no such file or directory: 'ext/gettext/gettext.o' 
clang: error: no such file or directory: 'ext/intl/php_intl.o' 
clang: error: no such file or directory: 'ext/intl/intl_error.o' 
clang: error: no such file or directory: 'ext/intl/intl_convert.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_class.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_sort.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_convert.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_locale.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_compare.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_attr.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_create.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_is_numeric.o' 
clang: error: no such file or directory: 'ext/intl/collator/collator_error.o' 
clang: error: no such file or directory: 'ext/intl/common/common_error.o' 
clang: error: no such file or directory: 'ext/intl/formatter/formatter.o' 
clang: error: no such file or directory: 'ext/intl/formatter/formatter_main.o' 
clang: error: no such file or directory: 'ext/intl/formatter/formatter_class.o' 
clang: error: no such file or directory: 'ext/intl/formatter/formatter_attr.o' 
clang: error: no such file or directory: 'ext/intl/formatter/formatter_data.o' 
clang: error: no such file or directory: 'ext/intl/formatter/formatter_format.o' 
clang: error: no such file or directory: 'ext/intl/formatter/formatter_parse.o' 
clang: error: no such file or directory: 'ext/intl/normalizer/normalizer.o' 
clang: error: no such file or directory: 'ext/intl/normalizer/normalizer_class.o' 
clang: error: no such file or directory: 'ext/intl/normalizer/normalizer_normalize.o' 
clang: error: no such file or directory: 'ext/intl/locale/locale.o' 
clang: error: no such file or directory: 'ext/intl/locale/locale_class.o' 
clang: error: no such file or directory: 'ext/intl/locale/locale_methods.o' 
clang: error: no such file or directory: 'ext/intl/dateformat/dateformat.o' 
clang: error: no such file or directory: 'ext/intl/dateformat/dateformat_class.o' 
clang: error: no such file or directory: 'ext/intl/dateformat/dateformat_attr.o' 
clang: error: no such file or directory: 'ext/intl/dateformat/dateformat_data.o' 
clang: error: no such file or directory: 'ext/intl/dateformat/dateformat_format.o' 
clang: error: no such file or directory: 'ext/intl/dateformat/dateformat_parse.o' 
clang: error: no such file or directory: 'ext/intl/msgformat/msgformat.o' 
clang: error: no such file or directory: 'ext/intl/msgformat/msgformat_attr.o' 
clang: error: no such file or directory: 'ext/intl/msgformat/msgformat_class.o' 
clang: error: no such file or directory: 'ext/intl/msgformat/msgformat_data.o' 
clang: error: no such file or directory: 'ext/intl/msgformat/msgformat_format.o' 
clang: error: no such file or directory: 'ext/intl/msgformat/msgformat_helpers.o' 
clang: error: no such file or directory: 'ext/intl/msgformat/msgformat_parse.o' 
clang: error: no such file or directory: 'ext/intl/grapheme/grapheme_string.o' 
clang: error: no such file or directory: 'ext/intl/grapheme/grapheme_util.o' 
clang: error: no such file or directory: 'ext/intl/resourcebundle/resourcebundle.o' 
clang: error: no such file or directory: 'ext/intl/resourcebundle/resourcebundle_class.o' 
clang: error: no such file or directory: 'ext/intl/resourcebundle/resourcebundle_iterator.o' 
clang: error: no such file or directory: 'ext/intl/transliterator/transliterator.o' 
clang: error: no such file or directory: 'ext/intl/transliterator/transliterator_class.o' 
clang: error: no such file or directory: 'ext/intl/transliterator/transliterator_methods.o' 
clang: error: no such file or directory: 'ext/intl/idn/idn.o' 
clang: error: no such file or directory: 'ext/intl/spoofchecker/spoofchecker_class.o' 
clang: error: no such file or directory: 'ext/intl/spoofchecker/spoofchecker.o' 
clang: error: no such file or directory: 'ext/intl/spoofchecker/spoofchecker_create.o' 
clang: error: no such file or directory: 'ext/intl/spoofchecker/spoofchecker_main.o' 
make: *** [libs/libphp5.bundle] Error 1 

我試圖谷歌繞瞭解決方案,但不幸似乎沒有什麼發現。 任何人都可以幫助我,讓它工作?

+0

是否運行從正確的文件夾中的腳本(即PHP的未存檔的源文件夾)? – admdrew

+0

@admdrew如何確定哪個文件夾是未存檔的源文件夾?你能解釋更多嗎?基本上,我剛剛從php網站下載了php源文件,然後將其解壓縮,並使用上述說明在該文件夾中工作。原因是我試圖從最初內置於Mac OSX的php 5.3.13進行升級。 –

回答

0

你需要在編譯PHP才能運行「使測試」的配置後,所以才跑「製作」:

make 
make test 
sudo make install