BFH Handwriting Website Deployment
composer
composer is the standard for installing PHP packages. The Authorize.net and PayPal SDKs are distributed with composer.
Prerequisites
git- See Namecheap's documentation about using
giton shared servers. - Basically
gitis installed, but the path togit(/usr/local/cpanel/3rdparty/bin) has to be added to bash'sPATH.
- See Namecheap's documentation about using
Installation
composer is not available on Namecheap servers. It's necessary to install it manually.
sshto the servercdto site root directory- Follow the instructions from the Download Composer page.
Installing and updating packages
- Composer requirements are stored in
composer.json.- Edit this file locally and upload it to the Namecheap server.
- Don't edit the file on the production server, or add requirements to it on production by running
composer require.
composerarguments.pharfiles are not whitelisted in Namecheap'sphp.ini. It's necessary to override this when installing and runningcomposer, e.g.-d suhosin.executor.include/whitelist=phar- Namecheap puts a low memory limit on the PHP processes. It may be necessary to increase this limit, e.g.
-d memory_limit=1G - Authorize.net's documentations places some dependencies in
require-dev, however running composer with the--no-devoption throws a bunch of errors. Even in production environments it's therefore necessary to not use this option. - Some of Authorize.net's dependencies are hosted on GitHub. Therefore it's necessary to have access to the
gitexecutable in order to runcomposer update.
On the production server, in the root directory of the site, run:
$ php -d suhosin.executor.include.whitelist=phar -d memory_limit=1G composer.phar update