Welcome to the new Zamblek — and the new Sngine website - The new Zamblek website is live — and with it, a new home for Sngine, your licenses, support, and the entire ecosystem. اعرف المزيد
What’s New with v4.5! - Sngine v4.5 comes with a lot of new features اعرف المزيد
Sngine 4.5 Release! - Our Sngine team is so pleased to announce the release of Sngine 4.5! With some improvements, اعرف المزيد

🛠️ Issue: “The file type is not a valid image” when using Social Login

When you are using social login (e.g., Facebook, Google, etc.), you may encounter the following error:

Zamblek Zamblek 2 دقيقة قراءة
جدول المحتويات
🛠️ Issue: “The file type is not a valid image” when using Social Login

When you are using social login (e.g., Facebook, Google, etc.), you may encounter the following error:

“The file type is not a valid image”

❓ Why does this happen?

Although it may appear to be a bug in Sngine, the real cause is a server-side PHP configuration issue, specifically related to the setting:

allow_url_fopen

This PHP directive controls whether PHP can fetch files using URL-based paths (e.g., https://...). Sngine relies on this feature to download the user’s profile picture from the social login provider (like Facebook). If allow_url_fopen is disabled, PHP can’t access external URLs, and the image fetching fails—leading to the error message.


✅ How to Fix It

1. Check if allow_url_fopen is enabled

You can create a test PHP file with the following code and save it as test_allow_url.php :

<?php
if (ini_get('allow_url_fopen')) {
echo 'allow_url_fopen is enabled';
} else {
echo 'allow_url_fopen is disabled';
}

Upload this file to your /includes directory and access it via your browser.

Example: https://yourdomain.com/includes/test_allow_url.php

If it says “disabled”, then that’s the problem.

2. How to Enable It

If you are using shared hosting:

  • Check if you have access to PHP Selector or MultiPHP INI Editor in cPanel.
  • Look for allow_url_fopen and set it to On.

Still not fixed?

Alternatively, you can try creating a php.ini file and add it your /includes folder:

allow_url_fopen = On

Note: Some hosting providers may restrict this setting. If you can’t enable it yourself, contact your hosting support and ask them to enable allow_url_fopen for your account.

3. For VPS or Dedicated Servers

If you manage your own server, open your main php.ini file and make sure you have:

allow_url_fopen = On

Then restart your web server:

# Apache
sudo systemctl restart apache2

# Nginx + PHP-FPM
sudo systemctl restart php-fpm

✅ Final Thoughts

This issue is not a direct bug in Sngine but rather a server configuration that Sngine depends on. Ensuring allow_url_fopen is enabled on both root dir and also inside /includes dir will fix the image fetching issue during social login and help other features that rely on accessing remote files.


That’s it.

Happy Sngine 🙂

Buy Sngine or Extend your support: https://bit.ly/BuySngine