2013-02-18 25 views
11

पर गेटटेक्स्ट को कैसे इंस्टॉल करें मैक पर गेटटेक्स्ट कैसे स्थापित करूं?मैकोज़ एक्स

मैं अपने php पृष्ठों में से एक पर इस त्रुटि मिलती है:

Fatal error: Call to undefined function bindtextdomain() 

और क्योंकि मैं स्थापित gettext नहीं है बस।

मुझे इसे इंस्टॉल करने के तरीके पर अच्छे निर्देश नहीं मिल रहे हैं। मैं का उपयोग कर की कोशिश की है:

brew install gettext 

और इसे यहाँ कुछ फ़ाइलों को कहते हैं:

/usr/local/Cellar/gettext/0.18.2

लेकिन मैं क्या से कोई लेना देना नहीं जानते उस।

अद्यतन: homebrew उपयोग करने की कोशिश करने के बजाय, अब मैं इस विधि की कोशिश की unsucessfully wget का उपयोग कर:

wget साथ डाउनलोड

cd ~/Downloads 
wget http://ftp.gnu.org/gnu/gettext/gettext-0.18.2.tar.gz 
tar -zxvf gettext-0.18.2.tar.gz 
cd gettext-0.18.2 
./configure 
make 

कर जांच आत्म परीक्षण चलाने के लिए वैकल्पिक है

make check 

त्रुटियां मुझे मिली:

मेकअप [3]: *** [चेक-परीक्षण] त्रुटि 1

मेकअप [2]: *** [चेक-बजे] त्रुटि 2

मेकअप [1]: *** [जांच पुनरावर्ती] त्रुटि 1

sudo make install 

कि इसे यहाँ स्थापित करता है: /usr/स्थानीय/शेयर/gettext

और प्रलेखन यहाँ: /usr/स्थानीय/शेयर/doc/gettext

लेकिन मैं अपने php पेज कैसे gettext और bindtextdomain() फ़ंक्शन का उपयोग करने में सक्षम हो सकता हूं?

उत्तर

8

मुझे अंततः यह मिला। आपको php को पुन: कॉन्फ़िगर करना होगा, इसलिए मैंने 5.3.15 से 5.4.12 तक अपग्रेड किया। इन वेबसाइटों बहुत मददगार थे:

http://mac.tutsplus.com/tutorials/server/upgrading-the-native-php-installation-on-os-x-mountain-lion/

http://mansion.im/2011/php-with-intl-and-gettext-on-osx-lion/

#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 
+1

धन्यवाद के बाद gettext लिंक करने के लिए; इससे मुझे "-बैश: envsubst: कमांड नहीं मिला" में मदद मिली "मुझे अपने मैक (ओएस एक्स 10.8.5) –

0

मैं एक सबसे आसान काम कर समाधान, जो अभी भी लीक से हटकर व्यक्तियों पर काम करता है पाया। संदेश यह है: https://stackoverflow.com/a/11792640/512504

44

आप brew उपयोग कर सकते हैं स्थापित करने के लिए यह

brew install gettext 
brew link --force gettext 
+4

पर मिला है, मैंने यह काम किया है, यह मैक ओएस – Rito

+0

से वितरित php से लिंक नहीं प्रतीत होता है यह मेरे लिए पूरी तरह से काम करता है ओएसएक्स एल कैपिटन पर। – brujoand

+0

धन्यवाद यह काम किया –

संबंधित मुद्दे