Fixing the 'decoct() Argument Must Be of Type Int' Error in Duplicator
Content
If you're encountering a fatal error during a Duplicator migration that mentions decoct(): Argument #1 ($num) must be of type int, string given, you're not alone. This is a common issue that arises from a PHP version compatibility problem between the server where the package was created and the server where you are trying to install it. This guide will explain why this happens and walk you through the most effective solutions.
Understanding the Problem
This error occurs when the Duplicator installer script (installer.php) tries to set file permissions on the new server. The specific function decoct(), which converts decimal numbers to octal (used for permission values), became more strict in PHP 8.0+. It now requires a pure integer as input.
The error suggests that the script is receiving a string instead of an integer. This typically happens because the package was built on a server with an older version of PHP (e.g., 7.4) and is now being installed on a server running PHP 8.0 or newer. The way file permission data is stored and passed between these versions has a slight incompatibility.
How to Resolve the 'decoct()' TypeError
Here are the most common and effective solutions, starting with the simplest.
Solution 1: Create a New Package on a PHP 8.0+ Server
The most straightforward fix is to avoid the version mismatch altogether.
- On your destination server (where you are trying to install), ensure it is running a supported PHP version (e.g., 8.0, 8.1, or 8.2).
- On your original server, temporarily change its PHP version to match the destination server (e.g., 8.1). You can usually do this from your hosting control panel (cPanel, Plesk, etc.).
- Once both servers are on a similar PHP version, use Duplicator to build a completely new package on the original server.
- Upload this new package and installer to your destination server and run the installation again. The error should no longer appear.
Solution 2: Manually Extract the Archive (Advanced)
If creating a new package is not possible, you can work around the installer script's permission function by manually extracting the files.
- Upload the Duplicator package (the
_archive.zipor_archive.daffile) and theinstaller.phpfile to your destination server's root directory via FTP/SFTP. - Using your hosting control panel's file manager or an FTP client, manually extract the archive file. Extract all contents into your website's root directory (e.g.,
public_html). This step bypasses the part of the installer that is causing the error. - Once the files are extracted, run
yoursite.com/installer.phpin your browser. The installer should now skip the extraction phase and proceed directly to the database setup and configuration steps.
Solution 3: Apply a Code Patch (Temporary Workaround)
Warning: This solution involves editing the installer.php file and is recommended only for advanced users. Always back up the file first.
The error is often triggered on a specific line of code. You can modify this line to force the value to be an integer.
- Open the
installer.phpfile from your destination server in a code editor. - Search for the line number mentioned in the error stack trace (e.g.,
line 607). - You will likely find a line of code similar to this:
$mode = decoct($mode); - Change this line to explicitly cast the variable
$modeas an integer before processing:$mode = decoct((int)$mode); - Save the file and upload it back to your server, overwriting the old one. Try running the installer again.
Conclusion
The decoct() type error is a classic case of a PHP version compatibility issue. The most permanent and reliable fix is to create a new package with matching PHP versions on both servers. If that's not an option, manually extracting the archive is a effective workaround that allows the installer to continue its job. For more persistent or complex issues, checking the server's error logs for additional clues can be helpful.
Related Support Threads Support
-
“Unexpected output” when running installer.phphttps://wordpress.org/support/topic/unexpected-output-when-running-installer-php/
-
Critical error in the general settingshttps://wordpress.org/support/topic/critical-error-in-the-general-settings/
-
Fatal error when using plugin duplicatorhttps://wordpress.org/support/topic/fatal-error-when-using-plugin-duplicator-2/
-
restore duplicator without installer.php filehttps://wordpress.org/support/topic/restore-duplicator-without-installer-php-file/
-
Installer not working – PHP 7.4 to 8.0https://wordpress.org/support/topic/installer-not-working-php-7-4-to-8-0/
-
Deprecated: Directive ‘allow_url_include’ is deprecated in Unknown on line 0https://wordpress.org/support/topic/deprecated-directive-allow_url_include-is-deprecated-in-unknown-on-line-0/
-
Duplicator server 200https://wordpress.org/support/topic/duplicator-server-200/
-
Uncaught Error: Class ‘DuplicatorInstallerCoreBootstrap’https://wordpress.org/support/topic/uncaught-error-class-duplicatorinstallercorebootstrap/
-
Fatal Errorhttps://wordpress.org/support/topic/fatal-error-3195/
-
Installing Backup on new server “[PHP ERR][FATAL] MSG:Uncaught TypeError”https://wordpress.org/support/topic/installing-backup-on-new-server-php-errfatal-msguncaught-typeerror/
-
Duplicator 1.5.4 – 400 Bad Requesthttps://wordpress.org/support/topic/duplicator-1-5-4-400-bad-request/
-
need to disable cron for duplicator to runhttps://wordpress.org/support/topic/need-to-disable-cron-for-duplicator-to-run/
-
PHP error “$this cannot be used in static methods”https://wordpress.org/support/topic/php-error-this-cannot-be-used-in-static-methods/
-
trying to install a backup in xampp, permission deniedhttps://wordpress.org/support/topic/trying-to-install-a-backup-in-xampp-permission-denied/
-
Plugin Fatal error – php 8.0.1https://wordpress.org/support/topic/plugin-fatal-error-php-8-0-1/
-
Duplicator WordPress Install Error Messagehttps://wordpress.org/support/topic/duplicator-wordpress-install-error-message/
-
Unknown format specifier “�”https://wordpress.org/support/topic/unknown-format-specifier-%ef%bf%bd/
-
Error 500https://wordpress.org/support/topic/error-500-137/
-
Uncaught Error: Call to a member function isRunninghttps://wordpress.org/support/topic/uncaught-error-call-to-a-member-function-isrunning/
-
BOOT SHUTDOWN FATAL ERRORhttps://wordpress.org/support/topic/boot-shutdown-fatal-error/
-
Switched from php 7.2/3 to php 7.4 – Duplicator pages become blankhttps://wordpress.org/support/topic/switched-from-php-7-2-3-to-php-7-4-duplicator-pages-become-blank/
-
An unknown issue has occurred with the update setup stephttps://wordpress.org/support/topic/an-unknown-issue-has-occurred-with-the-update-setup-step/
-
Installation Problem: Unespected outputhttps://wordpress.org/support/topic/installation-problem-unespected-output/
-
PHP Deprecated notice with PHP 8.2https://wordpress.org/support/topic/php-deprecated-notice-with-php-8-2/
-
Translation loading for the `duplicator` domain was triggered too earlyhttps://wordpress.org/support/topic/translation-loading-for-the-duplicator-domain-was-triggered-too-early/
-
I’m installing Duplicator via wordpress installerhttps://wordpress.org/support/topic/im-installing-duplicator-via-wordpress-installer/
-
Fatal error after upgradehttps://wordpress.org/support/topic/fatal-error-after-upgrade-37/
-
PHP Errorhttps://wordpress.org/support/topic/php-error-302/
-
Unknown format specifier “�” in license.php:61https://wordpress.org/support/topic/unknown-format-specifier-%ef%bf%bd-in-license-php61/
-
Error in file Installer.phphttps://wordpress.org/support/topic/error-in-file-installer-php/
-
Can not find strings in translation managerhttps://wordpress.org/support/topic/can-not-find-strings-in-translation-manager/
-
Setup Crashes at Step 3https://wordpress.org/support/topic/setup-crashes-at-step-3/
-
Failed to open stream: No such file or directoryhttps://wordpress.org/support/topic/failed-to-open-stream-no-such-file-or-directory-44/
-
Duplicator problem – Call to undefined function phpround()https://wordpress.org/support/topic/duplicator-problem-call-to-undefined-function-phpround/
-
Call to undefined function wp_timezone_stringhttps://wordpress.org/support/topic/call-to-undefined-function-wp_timezone_string/
-
Duplicator – BOotloader Error While Restoring from Backuphttps://wordpress.org/support/topic/duplicator-bootloader-error-while-restoring-from-backup/
-
error Deprecatedhttps://wordpress.org/support/topic/error-deprecated-4/
-
Database only restore failinghttps://wordpress.org/support/topic/database-only-restore-failing/
-
Duplicator missing files that are present?https://wordpress.org/support/topic/duplicator-missing-files-that-are-present/
-
duplicator problem installer.phphttps://wordpress.org/support/topic/duplicator-problem-installer-php/
-
[BUG] Uncaught TypeError “DUPX.getNewURL is not a function” on Step 3 (WP 4.9.9)https://wordpress.org/support/topic/bug-dupx-getnewurl-not-a-function-1-3-x-step-3-of-localhost-installation/
-
error_log > PHP Depricated > DUPX_Bootstrap::$extractionTmpFolderhttps://wordpress.org/support/topic/error_log-php-depricated-dupx_bootstrapextractiontmpfolder/
-
Installer errorhttps://wordpress.org/support/topic/installer-error-3/
-
Warning: “continue” targeting switch is equivalent to “break”https://wordpress.org/support/topic/warning-continue-targeting-switch-is-equivalent-to-break-10/
-
Duplicator errorhttps://wordpress.org/support/topic/duplicator-error-6/
-
Install error ! DUPX_ServerConfighttps://wordpress.org/support/topic/install-error-dupx_serverconfig/
-
Exception errorhttps://wordpress.org/support/topic/exception-error-2/
-
This string is hardcoded and is not translatablehttps://wordpress.org/support/topic/this-string-is-hardcoded-and-is-not-translatable-7/
-
Duplicator Installer Errorhttps://wordpress.org/support/topic/duplicator-installer-error/
-
Class ‘MAGE_Setting_API’ not foundhttps://wordpress.org/support/topic/class-mage_setting_api-not-found/
-
AJAX ERROR! STATUS: parsererrorhttps://wordpress.org/support/topic/ajax-error-status-parsererror/
-
wordpress duplicator installer.phphttps://wordpress.org/support/topic/wordpress-duplicator-installer-php/
-
Error after installhttps://wordpress.org/support/topic/error-after-install-24/
-
EXCEPTION Call to undefined function add_shortcode_param()https://wordpress.org/support/topic/exception-call-to-undefined-function-add_shortcode_param/
-
Duplicator Error: BOOT SHUTDOWN FATAL ERRORhttps://wordpress.org/support/topic/duplicator-error-boot-shutdown-fatal-error/
-
error duplicator row 139https://wordpress.org/support/topic/error-duplicator-row-139/
-
duplicator cannot be activatedhttps://wordpress.org/support/topic/duplicator-cannot-be-activated/
-
call_user_func_array() errorhttps://wordpress.org/support/topic/call_user_func_array-error-11/
-
Dynamic property error with PHP 8.3https://wordpress.org/support/topic/dynamic-property-error-with-php-8-3/
-
upgrede phphttps://wordpress.org/support/topic/upgrede-php/
-
A Duplicator Pro scheduled backup has failed.https://wordpress.org/support/topic/a-duplicator-pro-scheduled-backup-has-failed/
-
Duplicator Server Status: 200 -successhttps://wordpress.org/support/topic/duplicator-server-status-200-success/