Troubleshooting extension installation errors

Successfully installing any Joomla! component / plugin / module depends on many factors and the process may be interrupted by a number of reasons. In this article we will be providing explanations and solutions for all possible situations.


Article Sections

  1. Folder Permissions
  2. FTP upload and the Install from Directory feature
  3. Blank page
  4. -1 - An error has occurred. Copy failed /
  5. Warning: Failed to move file!
  6. Unable to write entry - JInstaller: :Install: Cannot find Joomla! XML setup file
  7. Please enter a package directory
  8. JFolder::create: Path not in open_basedir paths - Unable to create destination
  9. Component Install: DB function reports no errors
  10. Error Building Admin Menus
  11. JTableMenu::_getNode Failed

Folder Permissions


The most common factor that intervenes in the installation process is how permissions are set for some key folders, in which components usually place their files.


Please make sure that you have enough read / write permissions set for the following Joomla! installation folders:


/tmp - Joomla! copies all uploaded files in this folder, it is absolutely necessary that it is writeable


/administrator/components - component backend files are being placed here


/administrator/language - backend language files for all extension types (components / plugins / modules) are being placed in this folder


/administrator/modules - all backend area modules are installed here


/administrator/manifests - manifest files (files used to guide the installation process) will be placed in this folder


/components - component frontend files are stored in this folder


/language - frontend language files for all extension types (components / plugins / modules) can be found here


/modules - frontend modules will be installed here


/plugins - all plugins are being installed in this folder


/media - some extensions place files in this folder. It is mainly used for media files, such as images or videos.


Notes:


  • In order to find out for which folders you need to verify permissions (for a certain extension) simply open the extension's installation package (.zip archive) and analyze it's folder structure.

  • Each of our components has its own Installing and uninstalling documentation section where all folders (related to it) that require 755 permissions are listed.

FTP upload and the Install from Directory feature


If you are having trouble uploading the installation package (through the default Extensions >> Extension Manager >> Upload Package File feature), you can simply upload the files on your website via FTP and install the component from there:


  • Extract the installation package (archive) into a folder (which can be named in any way you like) and upload this folder in the Joomla! installation's default tmp folder via FTP (using a FTP file manager like FileZilla).

  • Head to Extensions >> Extension Manager >> Install from Directory, provide the path to the uploaded folder and click on Install. Joomla! will automatically retrieve the needed files from the specified location.

Blank page


When attempting to install an extension through the default Extensions >> Extension Manager >> Upload Package File feature you might get a blank page after clicking on Upload & Install. If this is the case, you will need to check whether your PHP is configured in such manner that it displays errors or not, as it is necessary to know what error is being returned by PHP in order to find a solution.

To do so, head to Site >> System Information >> PHP Settings and check if Display Errors is marked as On. If you find it to be marked as Off, please edit your php.ini file on your server and set display_errors to On. Note that you will need to restart your server in order for this to work. There are 2 solutions for your issue:


  • Head to Site >> Global Configuration >> Server and set Error Reporting to Development. Now Joomla! will report all errors and warnings as they occur.

  • As it is very likely that you do not have access to the server's php.ini file, you can add the following code at the top of your index.php file:

  • <?php error_reporting(E_ALL);
     ini_set("display_errors", 1); ?>

    The code will activate the display_errors option for your website.


-1 - An error has occurred. Copy failed /


This occurs when Joomla! fails to copy a file / folder from the tmp folder to it's destination. It is, most likely, generated by the fact that there are not enough write permissions set up for the destination folder. To fix this, simply make sure that there are enough permissions set for the destination folder.



In Joomla! 3.x:


  • edit the libraries/src/Filesystem/Folder.php file

  • look for the following code (around lines 155-159):

  • if (!@copy($sfid, $dfid))
    {
      throw new \RuntimeException('Copy file failed', -1);
    }
    

  • and replace it with this one:

  • if (!@copy($sfid, $dfid))
    {
      throw new \RuntimeException('Copy file failed  '.$sfid.' => '.$dfid, -1);
    }
    

The code above will improve how the error message is displayed by adding the source and destination folders to it. This way, you will be able to know exactly which folders do not have enough permissions set.


Warning: Failed to move file!


This error occurs when Joomla! does not manage to move a file from the server's tmp folder to your website's tmp folder. This may be caused by incorrectly set up permissions or wrongly provided path to the tmp folder.



Another solution to this would be to first unzip the package contents, upload them via FTP in one or your website's folders, and then install the package via the Extensions >> Extension Manager >> Install from Directory feature.


Unable to write entry - JInstaller: :Install: Cannot find Joomla! XML setup file


All extensions are installed based on an XML file which provides destinations for all of the component's files and folders. If this file cannot be found (because the .zip package could not be extracted), you will get this error message.


The solution to this problem is to install the extension as explained in this article's FTP upload section.



Please enter a package directory


When installing an extension via FTP upload, providing an incorrect path (or none at all) to the folder which contains the extension's installation files will render Joomla! to throw this error message. Please apply the following in order to identify the correct path to use:


  • edit the libraries/joomla/filesystem/install.php file

  • look for the following code (around lines 198-201):

  • if (!is_dir($p_dir)) {
    JError::raiseWarning('', JText::_('COM_INSTALLER_MSG_INSTALL_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
    return false;
    }

  • and replace it with this one:

  • if (!is_dir($p_dir)) {
    JError::raiseWarning('', JText::_('COM_INSTALLER_MSG_INSTALL_PLEASE_ENTER_A_PACKAGE_DIRECTORY').' | Example : '.JPATH_SITE.DS.'tmp');
    return false;
    }


JFolder::create: Path not in open_basedir paths - Unable to create destination


This occurs when the path to the tmp folder was provided incorrectly in Joomla!'s configuration (Site >> Global Configuration >> Server >> Path to Temp Folder field).


To fix the issue, make sure to specify the absolute path to the tmp folder. Another solution would be to install the extension through FTP upload.



Component Install: DB function reports no errors

JFTP: :delete: Bad response

JFTP: :delete: Bad response

Error installing component


The present error occurs when an extension was improperly installed. When this happens, some instances of the extension remain recorder in the database.



Head to Extensions >> Extension Manager >> click on Manage >> select the extension and click on Uninstall.


After doing so, open your database manager (for example, phpMyAdmin) and run the following query:


    DELETE FROM `#__menu` WHERE link LIKE '%com_component%';

    DELETE FROM `#__extensions` WHERE element = 'com_component';

    DELETE FROM `#__assets` WHERE name='com_component';

After doing so, please try reinstalling the extension.


Remember to:

  • Replace #_ with your database's actual prefix

  • Replace component (in com_component) with the actual name of your component. This is also available for plugins (plg_plugin) and modules (mod_module).

Error Building Admin Menus


This is only available for components, not plugins and modules. When this occurs, the component will be installed successfully but you will not be able to access it in the Components menu. To fix the problem, open your database manager (like phpMyAdmin) and run the following query:


    DELETE FROM `#__menu` WHERE link LIKE '%com_component%';

    DELETE FROM `#__extensions` WHERE element = 'com_component';

    DELETE FROM `#__assets` WHERE name='com_component';

Try reinstalling the component after running the query, it should appear in the Components menu this time.



Remember to:

  • Replace #_ with your database's actual prefix

  • Replace component (in com_component) with the actual name of your component.

JTableMenu::_getNode Failed


The result to this issue is the same as above, the component will not show up in the Components menu. However, the cause is different: the root item from the #__menu table(with id=1) is missing from the database. If the root menu no longer exists, Joomla! will not be capable of locating it's subsidiary menus.



To fix the issue, first run the following query in your database manager:


Joomla! 3.x

INSERT INTO `#__menu` (`id` ,`menutype` ,`title`  ,`alias` ,`note` ,`path` ,`link` ,`type` ,`published` ,`parent_id`  ,`level` ,
`component_id` ,`checked_out` ,`checked_out_time`  ,`browserNav` ,`access` ,`img` ,`template_style_id` ,`params` ,
`lft`  ,`rgt` ,`home` ,`language` ,`client_id` ) VALUES ( '1', '',  'Menu_Item_Root', 'root', '', '', '', '', '1', '0', '0', '0', '0', 
'0000-00-00 00:00:00', '0', '0', '', '0', '', '0', '0', '0', '*', '0')

then try installing the component one more time.


16 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that