QUESTION :
How do I run apache2 on Macos Yosemite. I am getting 2 errors:
Error #1
+ ulimit -S -n unlimited
/Applications/MAMP/Library/bin/apachectl: line 70: ulimit: open files: cannot modify limit: Invalid argument
Error #2
dyld: Symbol not found: _iconv
ANSWER :
The bash ulimit on Yosemite returns “ulimited” for the command “ulimit -H -n” this value cannot be set.
Check that a value for max files is set in /etc/sysctl.conf. I have (from postgres):
kern.maxfiles=524289
kern.maxfilesperproc=524288
With a default (ulimit -n) of 2560. See http://krypted.com/mac-os-x/maximum-files-in-mac-os-x/ for more details.
Change apachectl from:
ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`
to:
ULIMIT_MAX_FILES="ulimit -S -n `sysctl -A | grep kern.maxfiles: | awk '{ print $2}' `"
Problem 2: Rename envvars (MAMP specific)
cd /Applications/MAMP/Library/bin
mv envvars _envvars
As per: http://www.gladdy.uk/blog/2014/08/05/mamp-pro-on-yosemite-beta-5/