Installing mailparse php7 mbstring error

后端 未结 1 851
挽巷
挽巷 2020-12-19 05:03

I\'m currently working to put our project under php7.

When trying to compile the mailparse extension or use pecl to install it, I get this error:

#erro

1条回答
  •  醉梦人生
    2020-12-19 05:49

    You should be able to download the mailparse source, comment out the test for HAVE_MBSTRING in mailparse.c (around line 34), and build it normally.

    Here's what I did in Ubuntu 16.04 (assume 'sudo' when necessary):

    cd /tmp
    
    apt-get install php7.0-dev
    
    pecl download mailparse
    
    tar xvzf mailparse-3.0.2.tgz
    
    cd mailparse-3.0.2
    
    phpize
    
    ./configure
    
    sed -i \
      's/^\(#error .* the mbstring extension!\)/\/\/\1/' \
      mailparse.c
    
    make
    
    make install
    

    Then you just need to enable the mailparse.so module in your PHP configuration.

    For Ubuntu 16.04 and PHP-FPM, you'd use:

    echo "extension=mailparse.so" > \
      /etc/php/7.0/fpm/conf.d/30-mailparse.ini
    
    service php7.0-fpm reload
    

    0 讨论(0)
提交回复
热议问题