Title: Fatal PHP error Unsupported operand types: string * string
Last modified: August 11, 2022

---

# Fatal PHP error Unsupported operand types: string * string

 *  Resolved [southafricanrob](https://wordpress.org/support/users/southafricanrob/)
 * (@southafricanrob)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/)
 * Hi there,
    Thanks for an excellent and really easy to use plugin. I have been
   using it with now problems for a while but have suddenly run into an issue where
   if I enable “Rewrite Media URLs” (I am using Cloudfront) then I get a fatal PHP
   error on the frontend. Debugging give me this error:
 *     ```
       Fatal error: Uncaught Error: Unsupported operand types: string * string
       in /var/app/current/wp-content/plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php on line 1203
       ```
   
 * This seems to indicate that wp_get_attachment_metadata isn’t returning valid 
   dimensions?
    The wp_get_attachment_metadata value in the database contains this
   array which seems to contain the correct dimensions.
 * `a:6:{s:5:"width";i:566;s:6:"height";i:450;s:4:"file";s:36:"2022/08/62cc37c908f43219140781-
   6.jpg";s:8:"filesize";i:18577;s:5:"sizes";a:2:{s:6:"medium";a:5:{s:4:"file";s:
   36:"62cc37c908f43219140781-6-400x318.jpg";s:5:"width";i:400;s:6:"height";i:318;
   s:9:"mime-type";s:10:"image/jpeg";s:8:"filesize";i:21092;}s:9:"thumbnail";a:5:{
   s:4:"file";s:36:"62cc37c908f43219140781-6-150x150.jpg";s:5:"width";i:150;s:6:"
   height";i:150;s:9:"mime-type";s:10:"image/jpeg";s:8:"filesize";i:7102;}}s:10:"
   image_meta";a:12:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";
   s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";
   s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:
   5:"title";s:0:"";s:11:"orientation";s:1:"0";s:8:"keywords";a:0:{}}}`
 * I have disabled all plugins and set a default theme but am getting a consistent
   error. Any suggestions would be most welcome. Thanks

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Thread Starter [southafricanrob](https://wordpress.org/support/users/southafricanrob/)
 * (@southafricanrob)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15906752)
 * Apologies I forgot to attach the debug info:
 *     ```
       site_url(): https://mytank.co.za
       home_url(): https://mytank.co.za
       Database Name: mytankv2
       Table Prefix: wp_
       WordPress: 6.0.1
       Web Server: Apache/2.4.54 () OpenSSL/1.0.2k-fips
       PHP: 8.0.20
       MySQL: 8.0.28
       ext/mysqli: yes
       PHP Memory Limit: 256M
       WP Memory Limit: 256M
       Memory Usage: 18 MB
       Blocked External HTTP Requests: None
       WP Locale: en_ZA
       Organize offloads by month/year: Enabled
       WP_DEBUG: No
       WP_DEBUG_LOG: Yes
       WP_DEBUG_DISPLAY: Yes
       SCRIPT_DEBUG: No
       WP Max Upload Size: 32 MB
       PHP Time Limit: 60
       PHP Error Log: /var/log/php-fpm/www-error.log
       WP Cron: Disabled
       fsockopen: Enabled
       allow_url_fopen: Enabled
       OpenSSL: OpenSSL 1.0.2k  26 Jan 2017
       cURL: 7.79.1
       Zlib Compression: Enabled
       PHP GD: bundled (2.1.0 compatible)
       Imagick: Enabled
       Basic Auth: Disabled
       Proxy: Disabled
   
       Media Files: 40
       Offloaded Media Files: 10
       Not Offloaded Media Files: 30
   
       Number of Image Sizes: 6
   
       Names and Dimensions of Image Sizes: 
       thumbnail (150x150)
       medium (400x400)
       large (1024x1024)
       1536x1536 (1536x1536)
       2048x2048 (2048x2048)
   
       WP_CONTENT_DIR: /var/app/current/wp-content
       WP_CONTENT_URL: https://mytank.co.za/wp-content
       UPLOADS: Not defined
       WP_PLUGIN_DIR: /var/app/current/wp-content/plugins
       WP_PLUGIN_URL: https://mytank.co.za/wp-content/plugins
   
       AS3CF_PROVIDER: Not defined
       AS3CF_BUCKET: Not defined
       AS3CF_REGION: Not defined
       AS3CF_SETTINGS: Defined
       AS3CF_SETTINGS Keys: access-key-id, provider, secret-access-key
   
       Local URL:
       https://mytank.co.za/wp‑content/uploads/2022/08/photo.jpg
       Offload URL:
       https://images.mytank.co.za/wp‑content/uploads/2022/08/11084911/photo.jpg
   
       OME Metadata Version: 12
   
       Custom tables:
       wp_as3cf_items: Ok
   
       Storage Provider: Amazon S3
       Use Server Roles: Off
       Key File Path: N/A
       Access Keys Set: Yes
       Access Key ID Define: Not defined
       Secret Access Key Define: Not defined
   
       Bucket: mytank-uploads
       Region: af-south-1
       Block All Public Access: Unknown
   
       Copy Files to Bucket: On
       Enable Path: On
       Custom Path: wp-content/uploads/
       Use Year/Month: On
       Object Versioning: On
   
       Delivery Provider: Amazon CloudFront
       Rewrite Media URLs: On
       Enable Custom Domain (CNAME): On
       Custom Domain (CNAME): images.mytank.co.za
   
       Force HTTPS: Off
   
       Remove Files From Server: Off
   
       Active Theme Name: Hello Elementor Child
       Active Theme Version: 1.0.1
       Active Theme Folder: hello-theme-child
       Parent Theme Name: Hello Elementor
       Parent Theme Version: 2.6.1
       Parent Theme Folder: hello-elementor
   
       Active Plugins:
       ACF Conditional Taxonomy Rules (v3.0.1) by mattkeys
       Advanced Custom Fields (v5.12.3) by Delicious Brains
       Elementor (v3.6.7) by Elementor.com
       Elementor Pro (v3.6.5) by Elementor.com
       FluentSMTP (v2.1.2) by FluentSMTP & WPManageNinja Team
       Flying Pages (v2.4.6) by WP Speed Matters
       Flying Scripts (v1.2.3) by WP Speed Matters
       Payment Forms for Paystack (v3.4.1) by Paystack
       Query Monitor (v3.9.0) by John Blackbourn
       WP Offload Media Lite (v2.6.2) by Delicious Brains
       WP Store Locator (v2.2.235) by Tijmen Smit
       WP Store Locator - CSV Manager (v1.2.12) by Tijmen Smit
       WP Store Locator - Statistics (v1.1.2) by Tijmen Smit
       WPAdmin AWS CDN (v2.0.12) by WPAdmin
       mytank (v1.1) by Rob
   
       Drop-ins:
       db.php - Query Monitor Database Class (Drop-in)
       ```
   
 *  [SeCrEt BoY™](https://wordpress.org/support/users/trongkhanh/)
 * (@trongkhanh)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15912822)
 * Have the same issue for a week ago… But i am using free version so that I just
   turn it off…
 *  Plugin Author [Delicious Brains](https://wordpress.org/support/users/deliciousbrains/)
 * (@deliciousbrains)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15916726)
 * [@trongkhanh](https://wordpress.org/support/users/trongkhanh/) does your site
   also use Elementor?
 * -IJ
 *  [SeCrEt BoY™](https://wordpress.org/support/users/trongkhanh/)
 * (@trongkhanh)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15916821)
 * [@deliciousbrains](https://wordpress.org/support/users/deliciousbrains/) Yes.
   It cause by Elementor? I saw Elementor has a big update. But the topic owner 
   just use Elementor Old vesion.
    -  This reply was modified 3 years, 10 months ago by [SeCrEt BoY™](https://wordpress.org/support/users/trongkhanh/).
 *  Thread Starter [southafricanrob](https://wordpress.org/support/users/southafricanrob/)
 * (@southafricanrob)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15916965)
 * Hi there,
    I do use Elementor, disabling Elementor Pro fixed the fatal error 
   although I still get the same error or warnings other pages. I rolled both Elementor
   and Elementor pro back to older versions (3 versions back) but get the same issue.
   Is this specifically a conflict with Elementor?
 * Thanks
 *  Plugin Author [Delicious Brains](https://wordpress.org/support/users/deliciousbrains/)
 * (@deliciousbrains)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15917140)
 * Thanks for the updates.
 * We’ve seen a couple of customers have similar issues when using the most recent
   versions of Elementor.
 * Please contact Elementor for support as it seems like a recent update started
   injecting strings as the width and/or height of what we presume are dynamically
   generated image sizes. Width and height should be integers, for obvious reasons.
 * Please also be aware that WP Offload Media Lite does not have the support for
   Elementor that WP Offload Media does.
 * [https://deliciousbrains.com/wp-offload-media/doc/elementor-integration/](https://deliciousbrains.com/wp-offload-media/doc/elementor-integration/)
 * -IJ
 *  Thread Starter [southafricanrob](https://wordpress.org/support/users/southafricanrob/)
 * (@southafricanrob)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15919066)
 * Thanks, I have taken it up with Elementor.
 *  [SeCrEt BoY™](https://wordpress.org/support/users/trongkhanh/)
 * (@trongkhanh)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15922884)
 * [@southafricanrob](https://wordpress.org/support/users/southafricanrob/) Have
   the problem solved yet? What news from Elementor?
 *  Thread Starter [southafricanrob](https://wordpress.org/support/users/southafricanrob/)
 * (@southafricanrob)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15925679)
 * [@trongkhanh](https://wordpress.org/support/users/trongkhanh/) Not yet unfortunately–
   Elementor said they can’t provide support for other plugins, I did tell them 
   it appeared to be an issue with them though! If it helps – in the interim I have
   set up my uploads folder to mount as an EFS drive which is achieving the same
   result of offloading the media uploads, albeit without the CDN option.
 *  Plugin Author [Delicious Brains](https://wordpress.org/support/users/deliciousbrains/)
 * (@deliciousbrains)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15927437)
 * It looks like Elementor fixed the issue in v3.7.0 by disallowing strings in the
   width/height when using a “Custom” size for the Image widget.
 * We’ll have some protection in the next major release of WP Offload Media against
   this kind of invalid data in image sizes.
 * In the meantime, please update to Elementor 3.7.0 or later and then update any
   Images set with a custom size to make sure integer width and height are set by“
   Applying” the change and “Updating” the post from the Elementor editor.
 * In order to access the posts with invalid values in the custom sized Image widgets,
   you may need to temporarily deactivate WP Offload Media to avoid the invalid 
   data issue until the data is fixed.
 * Please note this problem only occurs with PHP 8.0+.
 * -IJ
 *  Thread Starter [southafricanrob](https://wordpress.org/support/users/southafricanrob/)
 * (@southafricanrob)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15928690)
 * Thanks for this info. I had rolled back to 3.6.5 but still had same issues, I
   didn’t realise the image sizes would still actually be saved incorrectly but 
   makes sense. Thanks again for the follow up.
 *  [SeCrEt BoY™](https://wordpress.org/support/users/trongkhanh/)
 * (@trongkhanh)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-15970313)
 * [@southafricanrob](https://wordpress.org/support/users/southafricanrob/) Hi,
   
   Don’t know why plugin developer always blame others… Maybe this is error caused
   by elementor but it just happen when amazon s3 and cloudfront activated. If without
   amazon s3 and cloudfont, elementor still working good without any string * string
   fatal error.
 * Just fix it by yourself [@southafricanrob](https://wordpress.org/support/users/southafricanrob/):
   /
   plugins/amazon-s3-and-cloudfront/classes/integrations/media-library.php Line 
   1203: add (int) like that `return ( (int)$a['width'] * (int)$a['height'] ) - ((
   int)$b['width'] * (int)$b['height'] );`
 *  Plugin Author [Delicious Brains](https://wordpress.org/support/users/deliciousbrains/)
 * (@deliciousbrains)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-16059348)
 * [@southafricanrob](https://wordpress.org/support/users/southafricanrob/) please
   checkout WP Offload Media Lite v3.0.0, should be fixed.
 * -IJ

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Fatal PHP error Unsupported operand types: string * string’ is closed
to new replies.

 * ![](https://ps.w.org/amazon-s3-and-cloudfront/assets/icon-256x256.jpg?rev=1809890)
 * [WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage](https://wordpress.org/plugins/amazon-s3-and-cloudfront/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-s3-and-cloudfront/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-s3-and-cloudfront/reviews/)

 * 13 replies
 * 3 participants
 * Last reply from: [Delicious Brains](https://wordpress.org/support/users/deliciousbrains/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/fatal-php-error-unsupported-operand-types-string-string/#post-16059348)
 * Status: resolved