'Cannot install simplexml extension on ubuntu 16.04
I'm running php5.6 on ubuntu 16.04. I am trying to upload files to an s3 bucket following steps from aws. When running the code I am getting this error:
PHP Fatal error: Class 'SimpleXMLElement' not found in .../vendor/aws/aws-sdk-php/src/Api/Parser/PayloadParserTrait.php on line 44
PHP Stack trace:
PHP 1. {main}() .../upload_to_s3.php:0
PHP 2. upload_to_s3() .../upload_to_s3.php:75
PHP 3. Aws\S3\S3Client->putObject() .../upload_to_s3.php:66
PHP 4. Aws\AwsClient->__call() .../upload_to_s3.php:66
PHP 5. Aws\AwsClient->execute() .../vendor/aws/aws-sdk-php/src/AwsClientTrait.php:86
PHP 6. GuzzleHttp\Promise\Promise->wait() .../vendor/aws/aws-sdk-php/src/AwsClientTrait.php:58
PHP 7. GuzzleHttp\Promise\Promise->waitIfPending() .../vendor/guzzlehttp/promises/src/Promise.php:62
PHP 8. GuzzleHttp\Promise\Promise->invokeWaitList() .../vendor/guzzlehttp/promises/src/Promise.php:226
PHP 9. GuzzleHttp\Promise\Promise->waitIfPending() .../vendor/guzzlehttp/promises/src/Promise.php:269
PHP 10. GuzzleHttp\Promise\Promise->invokeWaitList() .../vendor/guzzlehttp/promises/src/Promise.php:226
PHP 11. GuzzleHttp\Promise\Promise->waitIfPending() .../vendor/guzzlehttp/promises/src/Promise.php:269
PHP 12. GuzzleHttp\Promise\Promise->invokeWaitFn() .../vendor/guzzlehttp/promises/src/Promise.php:224
PHP 13. GuzzleHttp\Handler\CurlMultiHandler->execute() .../vendor/guzzlehttp/promises/src/Promise.php:248
PHP 14. GuzzleHttp\Handler\CurlMultiHandler->tick() .../vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:145
PHP 15. GuzzleHttp\Promise\TaskQueue->run() .../vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:118
PHP 16. GuzzleHttp\Promise\RejectedPromise::GuzzleHttp\Promise\{closure}() .../vendor/guzzlehttp/promises/src/TaskQueue.php:48
PHP 17. GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() .../vendor/guzzlehttp/promises/src/RejectedPromise.php:42
PHP 18. GuzzleHttp\Promise\Promise::callHandler() .../vendor/guzzlehttp/promises/src/Promise.php:169
PHP 19. Aws\WrappedHttpHandler->Aws\{closure}() .../vendor/guzzlehttp/promises/src/Promise.php:204
PHP 20. Aws\WrappedHttpHandler->parseError() .../vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:101
PHP 21. call_user_func:{.../vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:178}() .../vendor/aws/aw s-sdk-php/src/WrappedHttpHandler.php:178
PHP 22. Aws\Api\ErrorParser\XmlErrorParser->__invoke() .../vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:178
PHP 23. Aws\Api\ErrorParser\XmlErrorParser->parseXml() .../vendor/aws/aws-sdk-php/src/Api/ErrorParser/XmlErrorParser.php:42
I have tried install php-xml and get this:
php-xml is already the newest version (1:7.1+55+ubuntu16.04.1+deb.sury.org+1)
Trying to install a specific version ie. apt install php5.6-xml doesn't find packages and the simplexml.conf file is missing from mods-available.
I have a simplexml.ini in /etc/php/7.0/mods-available and have tried switching to php7.0 to try and correct these issues to no avail.
Any help on this would be much appreciated.
Solution 1:[1]
Found out my problem was with my aws user key. I was using the wrong key and it kept throwing this error. If anyone comes across this same issue, double check your key and hopefully you can save yourself the headache. No extensions needed to be installed to get it to work properly.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | tniles320 |
