I was trying to set up W3 Total Cache to work with Cloudfront+S3, but had trouble following a guide.
I added my access key id and the secred key, but when I try to create the distribution from the wordpress panel I just get a "failed" message.
I looked at the logs and this is what I found:
2018-11-22T01:10:19+00:00 CRITICAL Uncaught Error: Class 'DOMDocument' not found in /var/www/html/wp-content/plugins/w3-total-cache/lib/S3.php:1770
Stack trace:
#0 /var/www/html/wp-content/plugins/w3-total-cache/lib/S3.php(1403): S3::getCloudFrontDistributionConfigXML('myurl.com.a...', 'custom', true, '', '154234534.333'(I changed this number just in case.), Array, NULL, NULL, Array)
#1 /var/www/html/wp-content/plugins/w3-total-cache/CdnEngine_S3_Cf.php(363): S3::createDistribution(',myurl.com.a...', 'custom', true, Array)
#2 /var/www/html/wp-content/plugins/w3-total-cache/Cdn_AdminActions.php(471): W3TC\CdnEngine_S3_Cf->create_container('', 'Incorrect type.')
#3 /var/www/html/wp-content/plugins/w3-total-cache/Root_AdminActions.php(25): W3TC\Cdn_AdminActions->w3tc_cdn_create_container()
#4 /var/www/html/wp-content/plugins/w3-total-cache/Generic_Plugin_Admin.php(159): W3TC\Root_AdminActions->execute('w3tc_cdn_create...')
#5 /var/www/html/wp-includes/class-wp-hook.php(286): W3TC\Generic_Plugin_Admin->load('')
#6 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->app in /var/www/html/wp-content/plugins/w3-total-cache/lib/S3.php on line 1770
I'm unsure of where I have this problem. Did S3 changed and now it's not allowed to use an admin user for this task?
I was using this guide: https://www.youtube.com/watch?v=yaFt3lUvsH8 I get the fail at 9:54
Thanks for the help.
I was able to fix the issue.
I'm using an AWS AMI with Linux 2. Seems like a php plugin was missing.
sudo yum install php-xml
Solved my issue.