If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Issues with WordPress Site on Free Hosting

Started by spyindiaanu, Oct 19, 2023, 12:53 AM

Previous topic - Next topic

spyindiaanuTopic starter

It's a pleasure to meet you! I developed the website as per the design, installed it on the WordPress CMS, and everything worked perfectly on the local server.
However, when I uploaded the site to the free hosting provided by 000webhost, all the elements such as images, posts, and fonts disappeared. I also tried downloading the database through phpMyAdmin, but encountered no issues there.

It seems like the hosting service is struggling with processing PHP or is not properly supporting WordPress. Do you have any suggestions on how to resolve this issue?
  •  


EvgenijTito

There might be several reasons why you're having these issues, from hosting limitations to incorrect WordPress configurations or file permissions. Here are a few debugging steps that you can apply to identify and hopefully resolve the issue:

Check the WordPress URL Settings: In your WordPress settings, ensure the WordPress Address (URL) and Site Address (URL) reflect the correct and new URL of the live site.

Replace Local URLs: There might still be URLs in your database that point to your local development environment. You can use a plugin such as Velvet Blues Update URLs, Better Search Replace or a similar tool to replace the localhost URL to your actual site URL.

Check File Permissions: File permissions set incorrectly can cause content not to be displayed. Files should typically be 644 and directories should be 755. A plugin like "File Manager" could be useful for this if you don't have direct access to your server.

Investigate .htaccess: Make sure your .htaccess file is set up correctly. A misconfigured one can cause many unusual errors in WordPress. WordPress provides a default .htaccess file that should work well in most cases:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Inspect Element and Console: Use browser developer tools. This will help you to determine if this is an issue with the path to your images/fonts, or if something else is causing the problem (like JavaScript or PHP errors). It can also show you any server errors that are occurring in the background when you load pages.

Check with the Hosting Provider: While 000webhost supports PHP and WordPress, the free plan may have several limitations compared to other hosts. You may need to get in touch with their support to verify if the host does have such limitations.

Consider Upgrading or Switching Hosting Providers: If all else fails, you might want to consider upgrading to a paid plan on your current host or potentially switching to a different host. There are many affordable hosts out there that are highly optimized for WordPress, like SiteGround, Bluehost, etc.

Check for Plugin Conflicts: Often, issues with a WordPress site could be due to a conflict with a plugin. Try disabling all your plugins, and then re-enabling each one by one to see if a particular plugin is causing the problem.

Debugging in WordPress: Debugging in WordPress can give you more insight into what is happening with your website. You can enable debugging by adding these lines to your wp-config.php file:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
This will start logging errors to a file named debug.log in your wp-content folder. Check out those logs to see if there's anything significant that points to the issue.

Check PHP Version: Make sure that your hosting environment is using a PHP version that is fully compatible with the version of WordPress you're using. As of my knowledge cutoff in September 2021, WordPress recommends using PHP 7.4 or higher.

File Paths: Double-check your file paths. An incorrect file path could be the reason the images/posts/fonts are not showing up correctly. Remember, the file paths that worked on your local system might not work on the live server.

Image file permissions: Just like file permissions mentioned earlier, image file permissions could also prevent images from displaying on the website. You should check that your image file permissions are set properly.

Database Import Errors: If all the images/posts/fonts have disappeared, there could be an issue with the database import done on the live server. Make sure you imported the database properly, and there were no errors during the import process.

Check for updates: Make sure your WordPress, plugins and themes are fully updated. Sometimes compatibility issues may arise due to outdated WordPress plugins or themes.

Check the Uploads Folder: WordPress stores all your media in the "uploads" folder in the "wp-content" directory. There might be an issue with the transfer of this directory. Confirm that this directory was copied over during the migration.

Cross-Origin Resource Sharing (CORS): If you are storing media files on a different domain, CORS issues can arise. Consider either moving your data to the same domain as your WordPress install or properly configuring CORS on the server hosting your images.

Repair Database: It's also worth trying to repair your WordPress database. WordPress includes a database repair mode you can enable by adding the following line to your wp-config.php file:

define('WP_ALLOW_REPAIR', true);
After adding that line, you can navigate to http://yourwebsite.com/wp-admin/maint/repair.php to repair and optimize your database.

Debug with Query Monitor Plugin: This plugin enables debugging of database queries, PHP errors, hooks and actions, block editor blocks, enqueued scripts, and stylesheets, HTTP API calls, and more.

Remember, the key to debugging is to change one thing at a time and observe changes. It is a systematic practice to figure out what is going wrong. Be patient and thorough with it.
  •  

stexhibixtsum

Many choices exist. Ranging from connecting to databases (rather than importing them) to dealing with paths and PHP versions.

You may want to install a very stable build of PHP on your hosting console, similar to version 7.1. It is also recommended to keep your WP up-to-date with the latest version.

Take some time to meticulously scrutinize your topic with respect to relevant paths and examine any custom-built plugins you have. It's crucial to understand the effects of these elements on your project.
  •  

johmarcovaSemi

Did you switch routes in the database backup? Imagine you previously had a http://localhost, followed by the trial domain test.example.com.

A distinctive trait of WP lies in its ability to set down absolute file paths within the database.

Consider utilizing a text editor to swap all the 'localhost' instances with 'test.example.com'. Additionally, this tactic could potentially simplify the troubleshooting process or comprehensively avoid any possible migration-related issues.
  •  

sandertouw

What did you expect from a free hosting service? You get what you pay for. If you want a reliable hosting service, you need to be willing to pay for it. And while you're at it, why are you still using WordPress? It's so last season.
Have you considered using a more modern CMS like Ghost or Hugo? They're way more efficient and don't require all the bloatware that comes with WordPress. And if you're still having issues, maybe it's time to consider switching to a more reliable hosting provider or upgrading to a VPS or dedicated server.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...