Laravel Vapor
How to make Inspector works on Laravel Vapor.
When using Vapor you have to enable the "serverless" flag in the Application Settings.
Use the default Vapor runtime
Behind the scene, Inspector uses curl
to send data from your application to the monitoring system. In the default Vapor runtime curl is available in custom path, so you need to let the package know this path to properly build the curl command to send the data.
The package has an option for this configuration. You just need to publish the Inspector configuration file using the command below:
After publishing the config/inspector.php
file you can customize the curlPath field in the "options" property:
Test and Deploy
You can run the test command to verify everything is well configured before deploy in production:
Use Docker runtime
Docker based runtimes offer much more control over the execution environment, so you can deploy applications up to 10GB in size and allow you to install additional PHP extensions or libraries.
In order to use a Docker image instead of the Vapor native runtimes, set the runtime
configuration option to docker
within your vapor.yml
file:
To make Inspector works you must be sure that the current PHP installation in the Docker image has proc_open, and proc_close native functions enabled.
The default Docker runtime should have these functions enabled by default. In alternative you need to create a custom php.ini
file in your project root directory with these two functions not listed in the disable_functions parameter:
Add the entry below in your environment .Dockerfile
to override the default php.ini
configuration:
Increase ulimits
Ulimit is a Unix property used to set the number of open file descriptors for each process. It is also used to set restrictions on the resources used by a process. If the load on your application starts to increase due to background jobs, commands, or requests you could easily hit this limit for the underlying docker container behind your Vapor environment.
To increase this limit you can add ulimits
section to the vapor.yml
file for both production and staging environments.
Last updated