Skip to content

Instantly share code, notes, and snippets.

@kaistaerk
Last active June 17, 2020 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaistaerk/f5538197d06ac91b0a870599450d9d51 to your computer and use it in GitHub Desktop.
Save kaistaerk/f5538197d06ac91b0a870599450d9d51 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Change to temp dir
cd /tmp
# Install php dev package if not installed
apt-get install php-dev
# Download last mailparse version
pecl download mailparse
# Actually its 3.1.0, check if there is a newer version
# and modify the following lines
tar xzf mailparse-3.1.0.tgz
cd mailparse-3.1.0
# Run phpize
phpize
# Configure mailparse
./configure
# THE MAGIC:
# Disable the exception for mbstring
sed -i \
's/^\(#error .* the mbstring extension!\)/\/\/\1/' \
mailparse.c
# Make it
make
make install
##############################################################
# PHP Configuration
# This could be configured differently depending on the system
##############################################################
# Add php module
echo "extension=mailparse.so" > /etc/php/7.3/mods-available/mailparse.ini
# Activate php module
phpenmod mailparse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment