How to install localhost MAMP

Hello,

I have tried for a number of hours to install invoiceninja on a localhost with MAMP (Mac Apache MySQL PHP)

I have created a database etc. But when I go to install my installs it shows the directory of all the files… I am unable to get to the setup screen. I tried the bitnami version of invoiceninja not long ago and for some reason it is no longer supported there.

I would really like to try the software in a localhost environment. I have googled and there are no tutorials on how to install it on localhost… just ubuntu that I can find.

Thank you in advance,
Theo

I should mention when I have clicked to the /public/ folder and I get the following message:

Whoops, looks like something went wrong.

Hopefully someone can help me out.

Kind regards,
Theo

If you see a list of files try clicking the ‘public’ folder, it’s the default route for the app.

This can be changed by modifying the .htaccess file.

Thank you Hillel,

As mentioned in the second posting, I did click on the “public” folder – I had seen this as a step when reading through the forum. Unfortunately I get the following message in my browser:

Please check storage/logs/laravel-error.log for details about the error.

Thank you for the quick reply, I was still in the process of editing my last post and explaining the steps I took when your reply came in.

Here are the contents of the larval-error.log:

[2016-07-01 21:33:22] production.ERROR: exception ‘ErrorException’ with message ‘mcrypt_encrypt(): Key of size 0 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported’ in /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Encryption/McryptEncrypter.php:104 Stack trace: #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, ‘mcrypt_encrypt(…’, ‘/Volumes/Web/In…’, 104, Array) #1 /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Encryption/McryptEncrypter.php(104): mcrypt_encrypt(‘rijndael-128’, ‘’, ‘s:40:"368lRilUk…’, ‘cbc’, ‘~\x83\x99\xFF+\xB8\xE2\xCB\xCD\x07\x86#\x84B\xF7…’) #2 /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Encryption/McryptEncrypter.php(77): Illuminate\Encryption\McryptEncrypter->padAndMcrypt(‘368lRilUkHwQpWj…’, ‘~\x83\x99\xFF+\xB8\xE2\xCB\xCD\x07\x86#\x84B\xF7…’) #3 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(13002): Illuminate\Encryption\McryptEncrypter->encrypt(‘368lRilUkHwQpWj…’) #4 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(12966): Illuminate\Cookie\Middleware\EncryptCookies->encrypt(Object(Illuminate\Http\RedirectResponse)) #5 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #6 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(9862): call_user_func_array(Array, Array) #7 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #8 /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #9 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(3224): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #10 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #11 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(9862): call_user_func_array(Array, Array) #12 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #13 /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #14 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #15 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(9852): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #16 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(2338): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #17 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(2322): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #18 /Volumes/Web/Invoice-Ninja/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #19 /Volumes/Web/Invoice-Ninja/server.php(21): require_once(’/Volumes/Web/In…’) #20 {main} [] []
[2016-07-01 21:34:42] production.ERROR: exception ‘ErrorException’ with message ‘mcrypt_encrypt(): Key of size 0 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported’ in /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Encryption/McryptEncrypter.php:104 Stack trace: #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, ‘mcrypt_encrypt(…’, ‘/Volumes/Web/In…’, 104, Array) #1 /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Encryption/McryptEncrypter.php(104): mcrypt_encrypt(‘rijndael-128’, ‘’, ‘s:40:"y7Y2L28zS…’, ‘cbc’, ‘#\x9D\xC0N\xAAv~r&+\xAFG\xE1\xE0\xA3…’) #2 /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Encryption/McryptEncrypter.php(77): Illuminate\Encryption\McryptEncrypter->padAndMcrypt(‘y7Y2L28zSn9w6IL…’, ‘#\x9D\xC0N\xAAv~r&+\xAFG\xE1\xE0\xA3…’) #3 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(13002): Illuminate\Encryption\McryptEncrypter->encrypt(‘y7Y2L28zSn9w6IL…’) #4 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(12966): Illuminate\Cookie\Middleware\EncryptCookies->encrypt(Object(Illuminate\Http\RedirectResponse)) #5 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #6 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(9862): call_user_func_array(Array, Array) #7 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #8 /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #9 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(3224): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #10 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #11 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(9862): call_user_func_array(Array, Array) #12 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #13 /Volumes/Web/Invoice-Ninja/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #14 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #15 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(9852): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #16 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(2338): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #17 /Volumes/Web/Invoice-Ninja/bootstrap/cache/compiled.php(2322): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #18 /Volumes/Web/Invoice-Ninja/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #19 {main} [] []

Thank you for your time and patience with me.

Theo

Thank you Hillel,

As mentioned in the second posting, I did click on the “public” folder – I had seen this as a step when reading through the forum. Unfortunately I get the following message in my browser:

Here are the steps in point form I have taken to get here:

  1. I went into PHP My Admin and created a database to be used with invoiceninja
  2. Downloaded ninja-v2.6.7.zip from www.invoiceninja.com (not the github repository)
  3. Unzipped the contents and placed in the root of the hosting folder (I also created a folder called ninja and put the files in there, but it shouldn’t matter)
  4. I then went to the dashboard of MAMP and clicked on “websites” (websites being hosted my MAMP) – I get the root directory showing files and directories… I then clicked on the public directory

As mentioned in my last post, I was already in the process of writing the steps I took.

I have not been able to get to the page where I can enter the database name, its user and the users database for that database.

I use MAMP a lot of times for local testing of SAAS apps and this is the first time I have lost the battle so far. Not trying to create enemies here, but I just installed and configured invoiceplane without incident. So, I like to think I am of above average ability dealing with stuff like this. But, I digress.

I await a suggestion and really hope I can get invoice Ninja working in a local host environment.

Kind regards,
Theo

Try changing SomeRandomString to SomeRandomStringSomeRandomString in config/app.php

https://github.com/invoiceninja/invoiceninja/blob/master/config/app.php#L85

I tried it, no change. The string was initially empty:

I then tried what should have been there according to the github line 85:

and then as per your instructions:

I await further instructions, thank you.
Theo

If you have an .env file check if the APP_KEY value is set in it.

There is no “.env” file inside any of the directories, there is however a “env.php” if you drill down past the “vendor” directory. It however has nothing in it referencing “APP_KEY”

:frowning:

<?php
namespace JmesPath;

/**

  • Provides a simple environment based search.

  • The runtime utilized by the Env class can be customized via environment

  • variables. If the JP_PHP_COMPILE environment variable is specified, then the

  • CompilerRuntime will be utilized. If set to “on”, JMESPath expressions will

  • be cached to the system’s temp directory. Set the environment variable to

  • a string to cache expressions to a specific directory.
    */
    final class Env
    {
    const COMPILE_DIR = ‘JP_PHP_COMPILE’;

    /**

    • Returns data from the input array that matches a JMESPath expression.
    • @param string $expression JMESPath expression to evaluate
    • @param mixed $data JSON-like data to search
    • @return mixed|null Returns the matching data or null
      */
      public static function search($expression, $data)
      {
      static $runtime;
      if (!$runtime) {
      $runtime = Env::createRuntime();
      }
      return $runtime($expression, $data);
      }

    /**

    • Creates a JMESPath runtime based on environment variables and extensions
    • available on a system.
    • @return callable
      */
      public static function createRuntime()
      {
      switch ($compileDir = getenv(self::COMPILE_DIR)) {
      case false: return new AstRuntime();
      case ‘on’: return new CompilerRuntime();
      default: return new CompilerRuntime($compileDir);
      }
      }

    /**

    • Delete all previously compiled JMESPath files from the JP_COMPILE_DIR

    • directory or sys_get_temp_dir().

    • @return int Returns the number of deleted files.
      /
      public static function cleanCompileDir()
      {
      $total = 0;
      $compileDir = getenv(self::COMPILE_DIR) ?: sys_get_temp_dir();
      foreach (glob("{$compileDir}/jmespath_
      .php") as $file) {
      $total++;
      unlink($file);
      }

      return $total;
      }
      }

Note: some systems hide files which start with a . by default

Check if maybe the error has changed after switching to SomeRandomStringSomeRandomString

I have set the hide hidden files on my Mac and checked again, there is no file named “.env” so, I took it upon myself to find which files did contain “APP_KEY” here are the results:

I’m not sure, it’s odd that the value was initially blank.

You could try use SomeRandomString with rijndael-128 as the cipher

Does the string length matter?

Feel free to provide me a key inside “quotes” and I will insert it into line 85. This is not a production environment, so hacking isn’t going to be an issue. It’s only a test environment.

Kind regards and thank you,
Theo

Different ciphers require different key lengths.

Any value the right length should work.

https://www.tools4noobs.com/online_tools/encrypt/

I used the tool here with the default settings… it didn’t work.

Maybe I have to change the settings?

Kind regards,
Theo

You shouldn’t need to use a tool to convert a value.

If you haven’t already try recreating the database.