How to install gettext on MacOS X

后端 未结 4 1886
刺人心
刺人心 2020-12-13 18:43

How do I install gettext on mac?

I get this error on one of my php pages:

Fatal error: Call to undefined function bindtextdomain()

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 19:34

    If reinstall php is acceptable, try to download and install the php version you want from here.

    In my case, I used 7.0 version. Steps to reinstall:

    1. Open terminal and run curl -s https://php-osx.liip.ch/install.sh | bash -s 7.0
    2. The installed php will reside at /usr/local/php5-7.0.31-20180903-120321/lib (I'm not sure why the directory name is php5-7xxxx, but the installed php version is 7.0)

    3. Edit apache2 config at /private/etc/apache2/httpd.conf (make a backup if necessary)

    4. Replace LoadModule php7_module libexec/apache2/libphp7.so with LoadModule php7_module /usr/local/php5-7.0.31-20180903-120321/libphp7.so (remember to uncomment the "#" symbol), then save and exit.

    5. Finally, run apachectl restart to restart your apache server.

提交回复
热议问题