how to fix themes not installing wordpress

How to Fix Themes Not Installing on WordPress

Spread the love

Finding the right theme for your WordPress website can take some time. Once you found the right WordPress theme, installing the WordPress theme is often easy and straightforward.

However, sometimes you may face some problems or errors and the WordPress theme can’t be installed. You don’t want to look for another theme again and this theme was perfect for your website. You are in luck – join us in this guide to help you fix the WordPress theme not installing problem on your website.

There are a few different ways that this problem can be solved, so please try and check each one. Odds are something here will fix your problem.

Your uploaded theme file exceeds the maximum file size

Let’s say you downloaded the theme that you want to install, and you navigate to Appearance -> Theme -> Add New Theme and you upload your theme.

Then you receive the following error message:

The uploaded file exceeds the upload_max_filesize directive in php.ini

Based on the error message, your PHP configuration resticts file uploads to a size that is smaller than the theme you tried to upload. Just like the error suggests, to fix the problem you’ll need to increase the upload_max_filesize value. Once that’s done, you can upload the theme, and it’ll likely work.

How to increase max file upload size for PHP in cPanel

If you have WHM & cPanel, you can log in to your cPanel account and click on “MultiPHP INI Editor” and select the WordPress domain in the Select Location drop-down menu. Then you can increase the “upload_max_filesize” value to be higher than the size of the WordPress theme that you are uploading. For example, if your theme is 50 megabytes in size, we recommend setting it to something like 75 megabytes.

How to increase max file upload size for PHP using php.ini

In case you don’t have WHM & cPanel, you should change the upload_max_filesize value in the php.ini file. You can find the php.ini file by creating a new file phpinfo.php in the DocumentRoot of your WordPress website with the following content inside.

<?php

phpinfo( );

?>

Then go ahead and save this file and navigate to https://your-domain.com/phpinfo.php in your favorite browser and you can find the location of the php.ini file in the section “Loaded Configuration File“.

Then open the php.ini file in the location where it is found and change upload_max_filesize from 25M for example to a larger number – one that is larger than the theme you want to upload. Save the file and exit. Restart your web server.

Also, make sure to delete the phpinfo.php file from your web server as revealing information about your environment invites attackers to find ways into your server through vulnerabilities.

Your PHP memory limit is too low

Another error that you may face is exhausting the memory with the following error message in your PHP log:

Fatal error: Allowed memory size of X bytes exhausted.

Same as in the previous example, you should increase the PHP memory limit from cPanel or by finding the php.ini file on your server and increasing the value for the “memory_limit” variable.

You can change the memory limit from cPanel by logging in to your cPanel account and navigating to the “MultiPHP INI Editor” and selecting the WordPress domain in the Select Location drop-down menu, then you can change the “memory_limit” value.

If you are not using cPanel you can find the php.ini file by creating a phpinfo.php file that will show you the php.ini location on your server. Then adjust your memory_limit variable from the default 128M to a larger number, such as 256M or 512M. Make sure to restart your web server.

“Installation Failed: Could Not Create Directory” Error

Two scenarios may cause this error. Your server has run out of disk space, or your cPanel or DirectAdmin account has reached the disk quota. In some extreme cases, if your server has too many files, you may reach the inodes limit on your server. Inodes are used to identify unique files and folders – it’s possible to run out of numbers even without running out of disk space.

To fix this error you should delete some old or unused files to free up some space/inodes, or upgrade your hosting plan.

Lack of permissions or ownership by the web server

Another problem that you can face is your directory or files might have incorrect permissions or ownership.

You can change the file and directory permissions of the WordPress directory using FTP or SFTP through your FTP client, such as FileZilla. This is a free application for Windows, macOS and Linux that lets you remotely connect to your server.

You can select the WordPress DocumentRoot, righ-click on it and select File permissions…

Then you can set 755 in the numeric value field > select recurse into subdirectories > apply to directories only and click ok.

Again you can repeat the same procedure right-click on the DocumentRoot, select File permissions… and set 644 in the numeric value field > select recurse into subdirectories > apply to files only and click ok.

To change the file permissions from your terminal you can navigate inside the WordPress website directory and run the following commands.

find . -type f -exec chmod 644 {} +
find . -type d -exec chmod 755 {} +

This will set the correct permissions for your WordPress files and directories.

You may also need to change the ownership of the files and directories to your web server’s user. Depending on what Linux distribution and web server you’re using, this user is named differently. It could be www-data, nginx, or apache to name a few.

To set the ownership of your WordPress installation, let’s say your WordPress is installed at the directory /var/www/html/wordpress/. To change the ownership of the entire WordPress installation to your web server user (in our example it is www-data), you can do that like so:

chown -R www-data:www-data /var/www/html/wordpress

With that, your web server should now be able to access all WordPress files and folders properly.

Incompatible plugins

Sometimes plugin compatibility may be the issue when you are installing a new theme. It may cause a conflict and you won’t be able to install the new theme. This is especially possible if your theme depends on some plugins to function properly. You can test this by installing some WordPress plugin compatibility checker or disabling all the plugins one by one to check which plugin is causing the issue.

Some of the themes may have requirements that you can check before installing. This may include incompatibility with certain plugins, which PHP versions and WordPress versions can be used.

Parse or Syntax Error with your theme

Another problem that you might encounter when installing a new WordPress theme is when you try to install some custom theme in WordPress, and you receive a syntax error. It’ll usually say something about “parse error” and “syntax error”. In this case, there’s a code issue within the theme itself. You should contact the theme developer or check the theme code for any syntax errors in the code.

What about child themes?

Installing child themes works in the same way as installing parent themes. You just need to ensure you keep the parent theme of your child theme installed. If you see any errors with the child theme but not with the parent theme, it’s possible that it is a permissions issue, in which case you can scroll up and try to fix your permissions again.

Conclusion

By trying each of these solutions, you shouldn’t have any issues with themes not installing on WordPress. If you still have trouble, however, get in touch with our managed server support team and we’ll make sure your themes can be installed, or we’ll at the very least tell you exactly why it’s not possible to install your theme.

Leave a Reply

Your email address will not be published. Required fields are marked *