ARTIFACTORY: How to integrate PHP composer with Artifactory

AuthorFullName__c
Rasul Imanov
articleNumber
000005317
FirstPublishedDate
2022-06-23T08:45:32Z
lastModifiedDate
2025-05-15

ARTIFACTORY: How to integrate PHP composer with Artifactory

Setup (in Artifactory)

To get started: 

  • Go to the top right corner of the screen and click the "Welcome, admin" dropdown
  • Select Quick Setup
  • Select Composer
  • Enter your repository prefix and repositories are created


Fine tuning: When setting up your Remote PHP Repository, it is really important to navigate over to the repository
(Administration -> Repositories -> Repositories -> Remote -> <repo-key>) and edit the Registry URL that Artifactory resolves remote artifacts from.

User-added image

Also navigate over to your Virtual PHP Repository ((Administration -> Repositories -> Repositories -> Virtual -> <repo-key>) and confirm that your Virtual Repository resolves from local and remote. You may also add additional repositories under this list if you would like to resolve them from different remote locations. 
 

User-added imageSetup (in Composer)  


After our repositories are all set in Artifactory, we can go ahead and integrate these into our composer project by following the below steps:
Navigate into your project folder and locate your composer.json or config.json file 
Configure the "repositories" tag to use your virtual repository so both local and remote can be used
(ex: <art-url>/artifactory/api/composer/<repository key>)

User-added image