• chugbug

    (@chugbug)


    Hello. I’m trying to backup my website, but when I tried to use the EXPORT ZIP option for the theme, I got the following message: “There has been a critical error on this website”, then it supplied a link to the WP troubleshooting webpage. There I couldn’t find the specific information about the Export Zip (just a bunch of other error topics).

    If the google search results are correct (many times they’re out of date), it says I need to install the ZIP PHP extension from my hosts cPanel. So I installed the only zip related extension offered, which was called: Archive_Zip’ (Zip file archiving management class). Once I installed it, it gave me a line of code (below) and instructed me to add it to the ‘include path’.

    “You will need to add “/home/xxxxxxx/php” to the include path. You can do this by adding the following code to your script: ini_set(“include_path”, ‘/home/xxxxxxx/php:’ . ini_get(“include_path”) );
    NOTE: I replaced a folder name with ‘xxxxx’
    .

    My questions are:
    1) Am I on the right path? Was this the right PHP extension to install? If not what would it be called?
    2) If I did everything correct so far, where and HOW do I place the code? Put it in a notepad file and upload the file to a folder in my site directory?
    I have filezilla installed so I have access to the sites files/folders. But I don’t have an ‘include’ (or includes) direction in my theme directory. So do I create it?
    3) Use a plug in instead? When I searched google for help, I got a warning that I shouldn’t be adding code directly. Instead use a plugin (like WPCode). If I’ve done everything right so far, can I install the script using WPCode? (I don’t have it installed, but found it).

    Updated PHP version… I use to be able to export the zip file without any problems. But I remember a few months ago WP gave me a notice that I needed to update the php version. So I guess that update now has broken the abaility to use the Export Zip function (seems everytime I update something WP recommends, it ends up breaking something else).

    Some guidence would be appreciated.

    Thanks…JEB

Viewing 12 replies - 1 through 12 (of 12 total)
  • corrinarusso

    (@corrinarusso)

    If all you want to do it have a local back up of your website, use a tool like this:

    All-in-One WP Migration and Backup – WordPress plugin | ww.wp.xz.cn English (Canada)

    Also, most hosts provide a one click back up option.

    Lastly, the include directory is referring to your WordPress instance install path. But likely you will need to include your username path, like this,

    // Set the include path to include a custom directory
    ini_set('include_path', get_include_path() . PATH_SEPARATOR . '/home/chugbug/php');

    // look in /home/chugbug/php for includes
    include 'my_library.php';

    This will point to the script, not the php path.

    Thread Starter chugbug

    (@chugbug)

    Thanks for the suggestion.

    Sorry I don’t understand what your suggestings with the code. The ‘xxxx’ IS the user name. As I noted, I just replaced the actual name with the x’s (I didn’t want it shown).

    The only ‘includes’ folder I have is ‘wp-includes’ in the main (public_htlm) folder.

    corrinarusso

    (@corrinarusso)

    You can check your paths by creating a file called whatever.php, then just include this function,

    <?php phpinfo(); ?>

    and put the at the root and load it in your browser like domain.com/whatever.php

    Typically you cannot edit the php.ini file at your host, so there are ways around it. But sounds like you need to edit one of the files in the EXPORT thing provided by the theme. There are also other work arounds,

    Where is PHP.ini in WordPress? How to Locate & Edit it

    If this is a paid theme, be sure to ask the Author.

    Moderator threadi

    (@threadi)

    First of all, I’m wondering which “Export ZIP” option for themes you mean? This is not something that is included in WordPress. I suspect it comes from a plugin you are using. It would be essential to know this in order to be able to give you recommendations on what requirements your server (or the PHP running on it) must have in order to use it.

    If you don’t know the name of the plugin, take a look at your list of plugins. One of them will provide a function for this. If necessary, you can find out when the option disappears by deactivating individual plugins – then you’ll have it.

    You also mentioned a server-side error above. This is reflected in the error log. There you should also be able to see exactly what is causing the error. In my opinion, it is not yet clear whether it is really the PHP module for ZIP. Therefore, I think it would be dangerous to make changes to the server without really knowing that this will solve the problem.

    And regarding your question about the paths: your host’s support team should be able to tell you that. We don’t know your system here, we don’t know how it’s configured and what’s running on it. Any tip from here could be just as wrong as a Google search on the subject.

    Thread Starter chugbug

    (@chugbug)

    Hello and thanks for the suggestions.

    Corrinarusso – I’m using a custom theme I created myself using the ‘Create Block Theme’ plugin.

    Threadi –
    1) I did check the LIST of PHP extensions. As I stated in my original posted, this was the only extension related to ZIP. It also had a description that seemed to fit what I was looking for (Zip file archiving management class).

    2) EXPORT ZIP – Yes, the EXPORT ZIP is for the THEME. To access it, I click > Appearance > Editor > Templates. Next, click the theme you want to backup, then click a template. When it opens, click the wrench (top right). The Export Zip in in the list of options.

    I’ve only been using WP (WordPress) for a little over 2 years, and that option has always been there. I started with WP right before the Blocks feature came out (v6.0?) and I switch over to it right away. So block themes is all I’ve known (I wanted to work with a blank worksheet to create my own theme). Since I started out with the custom BLOCK theme, I always thought the theme’s Export Zip option was a WP feature. But maybe it’s specific to the Create Block Theme plugin.

    Turning off plugins – Since I’m using a custom theme, I was always very leary of turning plugins off and on. Especially with the theme. So I’d rather not try that. I use an accordion plugin that’s especially finisky. That really screwed things up once when I turned it off. It took the author quite a while to fix, so I’m sure you can understand my reluctance.

    Hopefully the theme plugin information will give you more to go on.

    Cordially…JEB

    Moderator threadi

    (@threadi)

    The “Export ZIP” option on a block template is provided by the “Create Block Theme” plugin you are using. According to their source code, they expect the PHP module ZipArchive as a prerequisite for exporting. If it is not there, an error message will appear that reads: “Unable to create a zip file. ZipArchive not available.” This is not a PHP error but should be visible to you in the backend. Source code for this: https://github.com/WordPress/create-block-theme/blob/trunk/includes/class-create-block-theme-api.php#L292

    However, you now get a server-side error when you call this up. This should be visible in the error log and also explain the problem. Therefore, I would recommend that you check your server’s error log again. Alternatively, you can also activate debug mode as described here: https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/

    If you need assistance with this, please contact your host’s support team first. Alternatively, you can find someone here who can provide you with personal support: https://jobs.wordpress.net

    If you have any questions about the Create Block Theme plugin, you can find their support forum here: https://ww.wp.xz.cn/support/plugin/create-block-theme/

    Thread Starter chugbug

    (@chugbug)

    Thanks for the suggestion.

    I contacted my host and they confirmed that I already had the zip archive extension I needed (that Google AI said I needed), so I didn’t need the additional archive extension I was tring to install. They also recommended increasing some php settings, but after I did so, they didn’t resolve it.

    So next, I’m going to run the DEBUGGING you suggested to see it will pinpint the error. But I but wanted to run the steps by you that I did before I uploaded the new file. Here’s what I did:
    1) I downloaded the wp-config.php file (using FileZilla);
    2) Opened wp-config.php (with Sublime);
    3) Copied over the four sets of debugging code into wp-config.php;
    4) Saved the updated file with a new name (wp-config-updated.php).

    I assume the next steps should be (PLEASE CONFIRM THESE):
    5) Upload the new file (wp-config-updated.php);
    6) Delete the original file (wp-config.php);
    7) Rename the updated file with the original name (wp-config-updated.php to > wp-config.php);
    8) Take a deep breath! Then open a webpage (and hope it loads).
    9) Look for the debug.log file in wp-content directory/folder.

    Question:
    a) Do I have to do anything special to get the log to start running? Such as log out and back in?
    b) I’m worred about breaking something. Since I can’t back everything up, I want to confirm that if the updated file causes a problem (breaks something that causes a page not to open), that I can fix it by coping the original file back over?

    Thanks again for the help…JEB

    Moderator threadi

    (@threadi)

    Yes, that is one way to edit the file. If you are still unsure about this, contact your host’s support team. They have access to everything anyway and can do it for you.

    To see the error in debug.log, you have to trigger it. So try downloading the ZIP file again. If it still doesn’t work, take a look at debug.log.

    Thread Starter chugbug

    (@chugbug)

    I’m comfortable with doing it, I just wanted to make sure I wasn’t missing a step. I’ll upload it tomorrow, then report back.

    Thread Starter chugbug

    (@chugbug)

    Hello, I added the code to enable the debug log file. If I’m reading it correctly, the error for the Archive Zip says “No such file or directory”. See below:

    [12-Jan-2026 22:00:25 UTC] PHP Warning: ZipArchive::addFile(): No such file or directory in /home/bradyje/public_html/wp-content/plugins/create-block-theme/includes/create-theme/cbt-zip-archive.php on line 24
    [12-Jan-2026 22:00:26 UTC] PHP Fatal error: Uncaught TypeError: parse_url(): Argument #1 ($url) must be of type string, array given in /home/REMOVED*/public_html/wp-admin/includes/file.php:1161
    Stack trace:
    Then it lists 16 different files and their directories. I assume these are the files it should be backing up.
    *NOTE: I removed the actual directory name.

    I have NOT made any changes to my directory. But I did update the plugin recently (v2.8.0). It never fails! I always try to make a copy of the plugin updates before I make them. But I hadn’t update the site for a while and almost all of them needed updated. So I didn’t make screenshots this time.

    Normally my next step would be to contact the plugin’s author, but i’s a WP.org plugin, so this is the only place i can to to for assistance.

    Here is a link to the plugin: https://ww.wp.xz.cn/plugins/create-block-theme

    Thanks…JEB

    Moderator threadi

    (@threadi)

    That’s a message that can help us move forward. However, it’s also strange. The location referred to in the message expects the path to a file that is to be added to the ZIP file—and this file apparently does not exist. This causes the message to appear.

    Now, of course, the question is which file exactly is involved. Which theme are you using? And does the message appear with every template from the theme or only with certain templates?

    The “Create Block Theme” plugin has its own support forum where you can and should ask questions about this: https://ww.wp.xz.cn/support/plugin/create-block-theme/ – members of the community who maintain the plugin read the posts there. This is not really the case here in the general forum.

    Thread Starter chugbug

    (@chugbug)

    Hi Threadi, thanks again for taking the time to help.

    First, I’m using a custom theme I created myself (the purpose of the plugin). It allows you to create a theme from scratch.
    Second, I get the error no matter what template I open. When I go into the templates panel, I don’t have the backup option until I choose a template. The left column shows two template options to choose from: ‘All templates’ or my custom theme template (called ‘blocktest’). I usually click blocktest since I only need to backup the templates I’m using, But I get the error no matter which of the two I choose. The ‘Export Zip’ icon isn’t available until you click the ‘wrench’ icon at the top right. Clicking the wrench gives you the Create Block Theme options. The Export Zip icon is at the bottom of the first group of options.

    NOTE: I thought this was important to mention. I thought I was running regular zip backups along with the regular WP Export (in ‘Tools’) and sql database backups. But when I look in the backup folders, the last one that contains a blocktest zip file is July 2024 (shortly after I began using the new WordPress site). So it’s possible the issue started a while ago but didn’t investigate it. Since I haven’t change anything with the theme since then, so I probably didn’t think a new zip backup was that important.

    Thanks for the [Create Block Theme] Support page link. I’ll begin posting there and reference this thread.

    Cordially…JEB

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

You must be logged in to reply to this topic.