<AMP-IFrame> 404 Error. AMP IFrame file is missing. Users will see the following error message: “Not Found. The requested URL /ampiframe.php was not found on this server.”
Respectively the shopping cart button, along with custom options and configurable options on your Magento 2 AMP pages, are missing. Please see the screenshot below:
Most likely, you are experiencing this 404 error right after installing the AMP extension via the composer. Sometimes the iframe file can be accidentally deleted or renamed, and therefore the AMP Iframe source is missing.
Check your AMP Magento Extension configuration. The AMP Iframe path field will display a location and the name of your AMP Iframe file as displayed below:
Check your Magento web root folder. Depending on your web server settings, the Magento DocumentRoot may be located in:
Now check the above folders. Most likely, the “ampiframe.php” is simply missing.
Copy the “ampiframe.php” file (provided with the module) to your Magento 2 webroot directory.
If you are serving files from the pub/ directory, then you must copy the “ampiframe.php” to pub/ folder:
cp /path/to/magento2/vendor/plumrocket/module-pramp/ampiframe.php /path/to/magento2/pub
Otherwise, please copy the “ampiframe.php” to your Magento 2 default webroot:
cp /path/to/magento2/vendor/plumrocket/module-pramp/ampiframe.php /path/to/magento2/
Now go back to your browser and refresh the AMP product page. The AMP Iframe should be displayed correctly.