Sunday, July 31, 2011

Restart Apache in MAC OS X

Apache webserver service can be restarted using the following command in a Mac OS X Terminal window:

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:

ULIMIT_MAX_FILES=""


My MAC OS X version is 10.6.5.
Hope this helps!

No comments:

Post a Comment