Skip to content
Ere Maijala edited this page Feb 9, 2021 · 2 revisions

VuFind development setup with MAMP

Note: MySQL's default root password is root

Adjust PHP path for a different version as necessary.

  1. Install MAMP

  2. Add the following lines to your ~/.profile file: export PATH=/Applications/MAMP/bin/php/php7.4.12/bin:/Applications/MAMP/Library/bin:$PATH Restart any terminal for the changes to take effect.

  3. Edit /Applications/MAMP/bin/php/php7.4.12/conf/php.ini. Uncomment the (last?) line to enable XDebug and add the following contents at the end:

    memory_limit = 2048M
    error_reporting = E_ALL
    display_errors = On
    sendmail_path = "env -i /usr/sbin/sendmail -t -i"    
    date.timezone = "Europe/Helsinki"
    error_log = /Users/[your id]/Library/Logs/php_errors.log
     
    [opcache]    
    opcache.enable=0
     
    [XDebug]
    xdebug.remote_enable=true
    xdebug.remote_autostart=true
    xdebug.remote_host=127.0.0.1
    xdebug.remote_port=9000
    xdebug.remote_handler=dbgp
    xdebug.show_exception_trace=0
    
  4. Copy VuFind's local/httpd-vufind.conf.sample to /Applications/MAMP/conf/apache/extra/httpd-vufind.conf

  5. Add the following line to the end of /Applications/MAMP/conf/apache/httpd.conf:

    Include /Applications/MAMP/conf/apache/extra/httpd-finna2.conf

  6. Restart services in MAMP using the button on the top right corner.

  7. Proceed with installation of VuFind's MySQL database, adding user for it etc.

Troubleshooting

If you need to add extensions using pecl and run into the following error message:

autom4te: need GNU m4 1.4 or later: /Applications/MAMP/Library/bin/m4

Install m4 from Homebrew (brew install m4) and overwrite MAMP's m4 with it: cp /usr/local/opt/m4/bin/m4 /Applications/MAMP/Library/bin/m4