sageone_api_php_sample
sageone_api_php_sample copied to clipboard
Fatal error: require(): Failed opening required '/var/php/vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php72/root/usr/share/pear')
I'm new to the API world so.. be gentle but I can't figure out what to do in this situation and when I commented this line //require '/var/php/vendor/autoload.php'; appeared:
- Fatal error: Uncaught Error: Call to undefined function SageAccounting\yaml_parse_file() in...
- SageAccounting\ClientConfiguration->load() #1...
- SageAccounting\ApiClient->loadClientConfiguration() #2 ...
- SageAccounting\ApiClient->__construct() #3...
Hello @devnb ! Sorry that you have problems with this application.
The recomended way to use the API Sample Application is to run it via the docker environment. That guarantees you that all dependencies are available in the correct version. So could you try this please? Before some minutes I tryed it, and it works well.
If you have questions about the Sage Business Cloud Accounting API or want to report problems, then the accounting api section of sagecity.com is the perfect place.
If you have questions, just ask :)
For anyone else with this issue do the following, this was done on a mac installing libyaml manually as homebrew kept failing.
-
You need libyaml installed (download, phpize, make install from here https://pecl.php.net/package/yaml)
-
Check this with phpinfo
-
Remove this part from the composer.json: "config": { "vendor-dir": "/var/php/vendor" }
Run composer dump-autoload
- Update the lib/api_client.php vendor include to: require dirname(FILE) . '/../vendor/autoload.php';
This should then run locally with:
php -S localhost:8080