sudo /usr/sbin/apachectl restart
Today, when I used this command to restart apache , from terminal after making some changes in php.ini file. it resulted in an error:
+ apachectl: /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
Then I looked into line 82 of apachectl, the shell script was referring to the ULIMIT_MAX_FILES variable, which was set to:
ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"
Changing the line as follows fixed the problem:
My MAC OS X version is 10.6.5.
Hope this helps!