Download the PHP package kerigard/lpsolve without Composer
On this page you can find all versions of the php package kerigard/lpsolve. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kerigard/lpsolve
More information about kerigard/lpsolve
Files in kerigard/lpsolve
Package lpsolve
Short Description LPSolve extension as simple PHP library
License MIT
Homepage https://github.com/kerigard/lpsolve
Informations about the package lpsolve
LPSolve
PHP wrapper around LPSolve 5.5, providing a safe and convenient interface for building and solving linear optimization problems.
Installation
Install via Composer
Load the Composer autoloader
[!IMPORTANT] This library requires the lp_solve PHP extension.
[!NOTE] The official lp_solve extension only supports PHP 5, so it needs to be compiled manually for modern PHP versions.
Building the lp_solve extension
(for PHP 5.6 - 8.x)
The repository Kerigard/lp-solve-php-docker contains maintained source directories for building the lp_solve extension for different PHP versions:
| Branch | PHP version |
|---|---|
5.x |
PHP 5.x |
7.x |
PHP 7.x |
8.x |
PHP 8.x |
1. Install lp-solve system package
2. Download source code
Replace 8.x with the desired branch.
3. Build and install
4. Enable the extension
Add to your php.ini:
Usage
Maximization with constraints
Minimization with bounds
Integer and Binary Variables
If you pass true instead of an array, all variables will become integer or binary.
Error handling
Invalid problem definition
Throwing exceptions for non-optimal solutions
Additional behavioral notes:
- The original lp_solve extension may produce fatal errors for malformed equations.
- When built via Kerigard/lp-solve-php-docker, internal errors become
LPSolveException. - Calling
->throw()forces an exception for all non-optimal results.
Callbacks
License
MIT. Please see the LICENSE FILE for more information.
All versions of lpsolve with dependencies
ext-lpsolve Version >=5.5.0.8