jide / clamp

Command Line Apache MySQL PHP
http://jide.github.io/clamp
GNU General Public License v2.0
79 stars 9 forks source link

Lockfile error when running clamp #18

Closed eivindml closed 7 years ago

eivindml commented 8 years ago

Fresh install of clamp gives this:

AH00526: Syntax error on line 6 of -c/-C directives:
Invalid command 'lockfile', perhaps misspelled or defined by a module not included in the server configuration
rqelibari commented 8 years ago

This error is caused by Apache.

LockFile is one of the directives of Apache ≤ 2.2. This was replaced by Mutex in Apache 2.4, which is the version of Apache installed with OS X 10.11, El Capitan.

Taken from this Stackexchange answer.

Besides that Apache now also needs to load mod_unixd.so to use the user command. I am currently working on a patch for this in my fork.

If you want a quick and dirty fix follow these steps:

  1. Add the following line to your clamp.json:

    {
    "apache": {...
      "loadmodule": {...
        "unixd_module": "/usr/libexec/apache2/mod_unixd.so"
        ...
      }
    }
    }
  2. Add the following line to /includes/Clamp/ApacheCommand.php:

    public function executeStart(array $args = array(), array $options = array())
    {
      if (!$this->isRunning($this->getPath($options['pidfile']))) {
        $this->preparePaths($options);
        unset($options['lockfile']);  // THIS LINE NEEDS TO BE ADDED
        ...
jide commented 8 years ago

Thanks @rqelibari,

Feel free to submit a PR !

rqelibari commented 7 years ago

For everyone stumbling upon this issue and running el capitan, see this thread for more information:

19