PHP integration handles uploads and file operations by wrapping Uploadcare Upload API and REST API. This comprehensive API client lets you use most of the Uploadcare features from within your PHP app.
Check out an example project that we created as a showcase for various usage scenarios and tasks that you can resolve.
Uploading (Upload API):
File management (REST API):
Image processing (URL API):
Security features:
PHP 7.4 and later or PHP 8 and laterphp-curlphp-jsonHow to check PHP version via CLI:
How to check modules:
You should see curl and json in the list:
Prior to installing uploadcare-php, get the Composer
dependency manager for PHP to simplify installation.
composer.json:Run Composer:
Define Uploadcare API keys:
Add API keys to your configuration object. For example:
Include Composer’s autoload file:
configuration objectThere’re a few ways to create a configuration object. We recommend that you use
this static method of the Uploadcare\Configuration class:
Alternatively, you can create a Security signature, HTTP client, and Serializer classes explicitly. After that, you can create a configuration object:
As you can see, the factory method is more convenient for standard usage.
That’s it! All further operations will use this configuration object.
Now that you have Uploadcare PHP API client up and running, you can do the following: