This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 9 replies, has 4 voices.

Last updated by Vasileios Chouliaras 1 year, 3 months ago.

Assigned support staff: Yvette.

Author Posts
March 22, 2019 at 11:58 am #3440067

Vasileios Chouliaras

Hi i try to change the flag with a svg or png icon and when i press upload i get a blank page.

At error log i see this.

#0 /home/mysite/mysite/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(938): WPML_WP_API->get_file_mime_type('/tmp/phpE2PdTc')
#1 /home/mysite/mysite/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(559): SitePress_EditLanguages->upload_flag(1)
#2 /home/mysite/mysite/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(528): SitePress_EditLanguages->handle_flag_post_data(Array, 1)
#3 /home/mysite/mysite/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(91): SitePress_EditLanguages->update()
#4 /home/mysite/mysite/wp-content/plugins/sitepress-multilingual-cms/menu/languages.php(25): SitePress_EditLanguages->__construct( in /home/mysite/mysite/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php on line 13

March 22, 2019 at 6:32 pm #3443519

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

Thank you for contacting us.

Probably above this error message should have another message snippet. Something like "Fatal Error". Please, could you check and post the complete error message here?

Thank you.

March 22, 2019 at 6:33 pm #3443523

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello,
Thank you for contacting WPML support.

1.- Have you tried to rewrite the files directly in wp-content/plugins/sitepress-multilingual-cms/res/flags ??

2.- Please increase the PHP Memory Limit. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/
You can add this to wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '128M');
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

- Add it above the line /* That's all, stop editing! Happy blogging. */

Also, please contact your hosting providers and ask them to update the MySQL version to meet out minimum requirements: https://wpml.org/home/minimum-requirements/

Kind regards,
Carlos

March 22, 2019 at 6:44 pm #3443707

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

I was unable to replicate this error on a sandbox site nor on my local server.

1. Min PHP memory allocation to WordPress
I noticed that you still have the default Worpress value of 40M configured for your installation. The minimum required for normal WPML operation is 128M - ideally it would be at 256M.

Please add the following line to your wp-config.php file

define('WP_MEMORY_LIMIT', '256M');

Please also note to make the size of the .png that you are trying to load to be something like 18x12pixels

If after changing the PHP memory allocation and also ensuring that the uploaded flag is the correct format/size you are still having issues, please write back with system access information and the precise steps you are using to upload the flag.

Thanks

March 26, 2019 at 8:27 am #3460207

Vasileios Chouliaras

Hi team and thanks for your fast reply. I was away for a few days.
I added this at my wp-config.php

/** Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

but still the same.

If i change the flags direct from ftp i will loose them on next update of the plugin? Thanks

March 26, 2019 at 3:44 pm #3464225

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Yes - you will lose it if you place the flag in a standard WPML directory since the upgrade will overwrite the directory contents.

Try one more thing: temporarily deactivate all of your non-WPML plugins and change your active theme to Twenty Seventeen. In this minimal setup, now try uploading the flag. It´s very important that you flag have the right size.

Maybe with the minimal setup it will now work.

March 27, 2019 at 8:16 am #3468493

Vasileios Chouliaras

Hi i deactivated all plugins except woocommerce and wpml. I tried again and i get the same

Stack trace:
#0 /home/mysite/mysite.com/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(938): WPML_WP_API->get_file_mime_type('/tmp/phppajyjU')
#1 /home/mysite/mysite.com/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(559): SitePress_EditLanguages->upload_flag(1)
#2 /home/mysite/mysite.com/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(528): SitePress_EditLanguages->handle_flag_post_data(Array, 1)
#3 /home/mysite/mysite.com/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(91): SitePress_EditLanguages->update()
#4 /home/mysite/mysite.com/wp-content/plugins/sitepress-multilingual-cms/menu/languages.php(25): SitePress_EditLanguages->__construct( in /home/mysite/mysite.com/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php on line 13

March 27, 2019 at 9:02 pm #3475775

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Would it be possible to connect to your site to see if I can check that our tables are correct in the database?

1. Temporary Access to your system
Please provide access to your system (wp-admin and ftp) so that I can further investigate this particular problem. The fields to provide this data are included in a private section that I will open for your next response. You can find it above the comments area. The information in this private section is only visible between WPML Support and you.

2. Please install and activate the ARI Adminer plugin

---- ALTERNATIVELY ---
Please provide a copy of your site as per these instructions:
https://wpml.org/faq/provide-supporters-copy-site/

March 28, 2019 at 5:18 pm #3484319

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

It seems that your server environment is missing the extension php_fileinfo.dll enabled in your php.ini. The system requires this module to be enabled in order for the uploading funciton to work.

You can contact your server support to enable this within your php.ini and it should resolve the issue.

As a temporary workaround, I´ve changed the following line of code in this file:
/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php

Change line: 13 in function "get_file_mime_type()" from this

$mime_type = mime_content_type( $filename );

to this

$mime_type = 'image/gif';

Once you have enabled the missing .dll, we can then revert the code back to what it was to confirm that the issue is resolved.

March 29, 2019 at 12:54 pm #3491411

Vasileios Chouliaras

My issue is resolved now. I added the php missing feature. I replaced the file to original and now all works ok. Thanks for your time