Snipe-IT Asset Management Installation Documentation

Welcome to the Snipe-IT documentation hub. You'll find comprehensive guides and documentation to help you install Snipe-IT as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Common Issues

While installation should be pretty simple, here are some of the more common questions/issues people have.

The requested URL /setup was not found on this server

Linux/OSX:

Chances are that mod_rewrite is either not installed on your system, or has not been configured correctly for your virtualhost using AllowOverride.

Troubleshooting:
Add garbage text into the public/.htaccess file on your local install and hit the homepage again. If it bombs out (it should), then mod_rewrite is probably working. If it doesn't, it means your webserver isn't even looking for the .htaccess rules and you'll need to check your virtualhost config.

(Make sure to take the garbage out of the .htaccess file once you've gotten it sorted!)

Windows:

The URL Rewrite module is most likely not installed on your system. Please install it, restart your server, and try again.

Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist'

Check your .env file and make sure there are no extra spaces on any of the lines of your config, and that any multi-word config options (or options with special characters) are enclosed in single-quotes.

For example, if you want your MAIL_FROM_NAME to be "Snipe-IT Asset Management", it should look like this in the .env file:

MAIL_FROM_NAME='Snipe-IT Asset Management'

Warning: require(/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory

When you see this error, it means that you either forgot to install or run composer, or you did and it failed somewhere and didn't complete, so the dependencies Snipe-IT needs were not installed. See the docs on installing and running composer, and check for any errors composer might return when you attempt to run composer install.

Once your composer errors are resolved, you can continue with the installation.

Error message: mcrypt_encrypt(): Size of key is too large for this algorithm

If this is a new install, you can run

php artisan key:generate

to auto-generate a key for you.

If it is an upgrade to v4 or later from an earlier version, you'll need to follow the recrypter instructions in the upgrade guide.

Error message: mcrypt_encrypt(): Key size not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported.

If this is a new install, you can run

php artisan key:generate

to auto-generate a key for you.

If it is an upgrade to v4 or later from an earlier version, you'll need to follow the recrypter instructions in the upgrade guide.

Permission error while running composer install

This will usually happen if composer install was run as root (which you should never do) at some point.

For more information on how Composer works, and how to fix it if you ran it as root, click here.

During install or running migrations - SQLSTATE[HY000]: General error: 1005 Can't create table 'snipeit.#sql-3626_1c6' (errno: 150)

This happens when your default table engine is set to MyISAM (which in general is weird. InnoDB has been the default table engine in MySQL for quite some time).

If you see this error:

Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1005 Can't create table 'snipeit.#sql-3626_1c6' (errno: 150) (SQL: alter table users add constraint users_company
_id_foreign foreign key (company_id) references companies (id))

[PDOException]
SQLSTATE[HY000]: General error: 1005 Can't create table 'snipeit.#sql-3626_1c6' (errno: 150)

Try running:

ALTER TABLE companies ENGINE = InnoDB;

on your MySQL database and then re-run migrations.

Class 'Aws\Laravel\AwsServiceProvider' not found or Class 'Log' not found

This typically happens when you have a config file left over from an upgrade that was previously deleted.

  • delete the files (not the directory) in bootstrap/cache
  • run composer dump-autoload
  • remove config/aws.php if it exists

Call to undefined function Controllers\Admin\ldap_connect()

The PHP LDAP extension is not installed on your server. While this extension is not required for all Snipe-IT installations, it must be installed if you wish to use any of the LDAP functionality.

White page with error: Error in exception handler.

Make sure you've changed the permissions on the storage directory and all of the directories within to be writable by the web server.

FatalErrorException. Syntax error, unexpected '[', expecting ')'

The version of PHP you're using is too old to run Snipe-IT, which requires PHP 5.5.9 or later.

After upgrading PHP, you should also delete the contents of the cached views in storage/framework/views once you upgrade PHP, to resolve any cached issues.

Error message: Error Output: PHP Fatal error: Call to undefined method IlluminateFoundationApplication::registerCoreContainerAliases() in ../src/Illuminate/Foundation/start.php on line 106

Remove bootstrap/compiled.php and your vendors dir, and try running php composer.phar update.

Image Source not readable

This usually means that the temporary directory is not writable by the web server. Check the permissions section of the documentation for your server OS and make sure you've granted the user the ability to write to the temp directory.

While running composer: intervention/image dev-master requires ext-fileinfo * -> the requested PHP extension fileinfo is missing or not enabled on your system.

As the error states, your server is missing the fileinfo extension, which is one of the requirements for running Snipe-IT.

Windows users must include the bundled php_fileinfo.dllDLL file in php.ini to enable this extension. To enable Fileinfo, add or uncomment this line in your php.ini:

extension=php_fileinfo.dll

and restart the web server.

Linux users need to add or uncomment the following in their php.ini:

extension=fileinfo.so

and restart the web server.

During composer install, it's asking me for my Github credentials

This is an artifact of Github having a very low API rate limit for unauthenticated accounts. Make sure you're using the --prefer-source flag when doing your composer installs and updates.

PHP Fatal error: Class 'Patchwork\Utf8\Bootup' not found in \bootstrap\autoload.php on line 43

This happens sometimes with composer, though we don't really know why, as it's not specific to Snipe-IT. If you run into this error after running php composer.phar install --no-dev --prefer-source, try the following:

  • delete your composer.lock file
  • run php composer.phar dump-autoload
  • run php composer.phar update --no-dev --prefer-source

Error: Insufficient permissions! after upgrading

While older versions of Snipe can be updated rather painlessly by simply using php artisan migrate, when upgrading from ancient versions (i.e. v1.1) to newer versions you may experience issues with user deletion, viewing backups etc.

This is due to the fact that migrations will not automatically add "Admin" users to the new "Super User" permission group.

To resolve (without raw SQL/db queries) try the following:

  • login as an admin user
  • create a new (throw away) admin user with Super User permissions
  • log out and log back in as new user
  • elevate all the users who need Super User
  • log out and back into your regular admin account that has just been elevated
  • delete the throw away user you created earlier to ensure elevation worked

ErrorException thrown with message "Undefined index: fields"

This happens when the URL you've set in your configuration is not the actual URL your installation is using, for example if you had http://snipe.local as your URL in your configuration, but you are accessing the page from http://snipe-it.local.

IMPORTANT:

The URL in your configuration must be the exact URL you use to access the site, or else you'll run into a CORS/domain policy error or a 404 on critical pieces.

Browser redirects to /login, but page is blank with a 500 error

Check the permissions of your storage directory. Normally when we see the framework fail so hard that it can’t even give you a framework-level error, it’s because of permissions issues.

Your storage directory and all subdirectories within should be writable by the web server.

PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in public/index.php on line 51

The version of PHP you're using is too old to run Snipe-IT, which requires PHP 5.6.4 or later.

After upgrading PHP, you should also delete the contents of the cached views in storage/framework/views once you upgrade PHP, to resolve any cached issues.

PHP Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE)

The version of PHP you're using is too old to run Snipe-IT, which requires PHP 5.6.4 or later.

After upgrading PHP, you should also delete the contents of the cached views in storage/framework/views once you upgrade PHP, to resolve any cached issues.

Error when LDAP syncing: ldap_control_paged_result_response(): No server controls in result

This unhelpful error happens when your connection didn't trigger any other errors, but it's not able to get any results. This can sometimes happen if your AD/LDAP server will only send results over TLS, and you don't have the "Use TLS" checkbox checked in Admin > Settings.

Changes to my .env file don't seem to be updating

Some web servers requires that you restart the web server after making changes to the .env file, so try restarting Apache/IIS/etc.

Also, if you ran the artisan command to cache your environmental variables for faster performance, run:

php artisan config:clear

to clear out your old cached values.

Exception in BaseEncrypter.php on line 44 getJsonPayload() -> throw new DecryptException('The payload is invalid.')

Disable Xdebug.

Broken Barcodes

If your barcodes are not showing up properly, there can be a few different explanations:

  • Check the permissions on your public/uploads/barcodes directory and make sure that directory is writable by the server.
  • Confirm that the barcode type you've selected is compatible with your asset tags. For example, if you have selected EAN5 barcodes need 5 characters, numbers only. If your asset tags are a combination of numbers and letters, that won't be compatible. That's just a limitation on the barcode specifications, not something specific to Snipe-IT.

"Whoops" error on checkin/checkout

If the item is correctly checked in or out in the database, but instead of returning you to the previous page, you see a "Whoops" error, the cause of this is usually that your email or your slack web hook is misconfigured. Check your settings and try again.

openssl_decrypt(): IV passed is 32 bytes long which is longer than the 16 expected by selected cipher, truncating

If you don't have any encrypted custom fields, this can be easily solved by simply regenerating your app key using:

php artisan key:generate

If you have encrypted custom fields, or if you have a stored LDAP password in your LDAP settings, you'll need to run the recrypter to decrypt and re-encrypt using the newer, more secure cipher.

Permission Denied error when trying to send a test mail on CentOS or RHEL

If you are using CentOS, RHEL or some other SELinux enabled distribution, SELinux may be preventing Apache from opening any outgoing sockets.

In order to allow it, run the following command:

setsebool -P httpd_can_network_connect on

Google Maps not loading

If your set your Google Maps API so you can display maps on locations and suppliers pages in v4.1.7+ and your maps aren't showing up, this usually means you haven't authorized your Google API key to use the Maps APIs. (It's a long, convoluted process that Google makes far more confusing than it should be.)

The easiest way to verify if this is what's happening is to view the map image url in a browser directly. You'll probably see something like "The Google Maps API server rejected your request. This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/static_maps_backend?project=_"

In the Google Developers console, go to Library, search for Maps and enable the Maps APIs. (If you want to limit it to just the ones we need, I think it's the Maps Simple Embed API or Static Maps API.)

It can take a minute or two after enabling those APIs for google to recognize that it’s authorized now.


What's Next

Getting Help

Common Issues